Using axvlc.dll version 3.0.3.0 in VB6

All you've ever wanted to know about the ActiveX, Mozilla plugins, the web interface and various PHP extensions
colincourtfarm
New Cone
New Cone
Posts: 4
Joined: 22 Jan 2019 10:29

Using axvlc.dll version 3.0.3.0 in VB6

Postby colincourtfarm » 22 Jan 2019 12:18

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!

chouquette
Developer
Developer
Posts: 291
Joined: 15 Apr 2010 00:54

Re: Using axvlc.dll version 3.0.3.0 in VB6

Postby chouquette » 22 Jan 2019 12:26

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!

colincourtfarm
New Cone
New Cone
Posts: 4
Joined: 22 Jan 2019 10:29

Re: Using axvlc.dll version 3.0.3.0 in VB6

Postby colincourtfarm » 22 Jan 2019 12:41

Hi chouquette,

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

chouquette
Developer
Developer
Posts: 291
Joined: 15 Apr 2010 00:54

Re: Using axvlc.dll version 3.0.3.0 in VB6

Postby chouquette » 23 Jan 2019 11:26

Oh my bad, I must have skimmed too quickly -_-

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

colincourtfarm
New Cone
New Cone
Posts: 4
Joined: 22 Jan 2019 10:29

Re: Using axvlc.dll version 3.0.3.0 in VB6

Postby colincourtfarm » 14 Feb 2019 00:17

No problem chouquette,

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

Cheers,

Colin


Return to “Web and scripting”

Who is online

Users browsing this forum: No registered users and 37 guests