0
votes

I've managed to get my .net DLL package that interfaces with DirectShow.net for image capture into vb6.

The .net DLL contains functions from the dxSnap sample provided in the DirectShow.net library, and works in .net applications. I've added Interop functions and VB6 recognizes the functions and works fine on return type functions.

There's a function to fetch a stream from a device and attach it to a control, but I'm getting type mismatch errors when passing a picture box, and overflow errors when passing a LEAD video control.

Is there a better way to get the stream into the vb6 application?

2

2 Answers

1
votes

The "better way" is to write your application in VB.Net, in managed code :)

1
votes

DirectShow normally needs a window handle to draw into so you can pass PictureBox.hWnd to one of your .NET functions using the IntPtr variable type.
If you need to retrun image data itself, COM Interop should handle conversion of an Image/Bitmap object to a COM StdPicture object for VB6, or you can pass a byte array containing a packed DIB or similar.