Page 1 of 1

Using axvlc.dll version 3.0.3.0 in VB6

Posted: 22 Jan 2019 12:18
by colincourtfarm
This may be of some help to users of the axvlc.dll. It relates to using that control in VB6.

We have a stud farm and we use cheap video cams on our LAN to monitor our horses especially near foaling time. As I am familiar with VB6 I wrote a Windows program that can be used to view and pan/tilt our cams. But when expanding our stabling we needed new (cheap) cams, and all the new ones in our price range were ONVIF cameras using H264 video.

To display video from those cameras I found the axvlc.dll which does a reasonable job of handling the display from them (and most of my older ones).
But there was one major problem with the dll - my existing program doesn't use any pan/tilt on-screen controls. Pan/tilt is activated by clicking on the video display (the display surface is divided into 9 squares conceptually and e.g. clicking in the upper right square will cause the camera to tilt up and pan right). I discovered that the dll's display surface is running in a different thread to the main program and it's not accessible via the properties exposed by the control so no possibility of 'click' events.

I'd have to use 'subclassing' to get the display window's message queue. The first job was to search for that window in the process's window tree to get its window handle. As the window was in a different thread to the main process's thread, using a WH_MOUSE hook to subclass the video output window's messages was a recipe for crashing the process both in the VB IDE and as an exe.

However the low level mouse hook (SetWindowsHookEx(WH_MOUSE_LL, ...)) (I believe) returns mouse messages in the context of the process's main thread. In that hook I can filter out mouse left button down messages and, using the WindowFromPoint API, determine if the mouse was clicked in the in the video output window. If that was the case I post a message back to the main window of the process to do the pan/tilt.

I can provide detailed code information if anyone is interested!

Re: Using axvlc.dll version 3.0.3.0 in VB6

Posted: 22 Jan 2019 12:26
by chouquette
Hi,

I took the liberty of moving your post to a more appropriate place :) Hopefully someone with more experience in VB/Windows development than myself will be able to help you!

Re: Using axvlc.dll version 3.0.3.0 in VB6

Posted: 22 Jan 2019 12:41
by colincourtfarm
Hi chouquette,

OK...but I wasn't actually looking for help, just hoped this might help someone :D

Re: Using axvlc.dll version 3.0.3.0 in VB6

Posted: 23 Jan 2019 11:26
by chouquette
Oh my bad, I must have skimmed too quickly -_-

Well thanks a lot for reporting back then! I hope it will help people :)

Re: Using axvlc.dll version 3.0.3.0 in VB6

Posted: 14 Feb 2019 00:17
by colincourtfarm
No problem chouquette,

I also hope it helps someone too! Sometimes it's so difficult doing things in 'older' software :D

Cheers,

Colin