View Full Version : Using DGDecode.dll with VB6
DoC hEx
24th June 2004, 00:44
Hi, I've trying to get VB6 to call the the DGDecode.dll (v1012), openMPEG2Source()
//C Code
extern "C" __declspec(dllexport) VideoInfo* __cdecl openMPEG2Source(char* file) Then Call from VB with...
'VB Code
Private Declare Function dll_OpenMPEG2 Lib "DGDecode.dll" Alias "openMPEG2Source" (ByVal strFileName As String) As Long
But I've had no luck with this. I've tried by ByRef and as a Long VarPtr. Does anyone have any ideas on this or has anyone tryed this and got it working???
vion11
25th June 2004, 10:10
You will have no luck with __cdecl. Info (http://support.microsoft.com:80/support/kb/articles/Q153/5/86.asp)
One should ask for neuron2 reasons for changing it...
DoC hEx
25th June 2004, 11:57
Thanks for the info, as I've only tried this from the IDE.
I'll have to compile the and see how it works then. I've also downloaded the VB6 sp6 to see if that will help any.
vion11
25th June 2004, 12:18
VB debugging features on compiled sources are not really helpfull :(
Where did you find the sources of dgdecode?
DoC hEx
25th June 2004, 14:39
Here you go!
http://neuron2.net/fixd2v/decodefix.html
vion11
25th June 2004, 15:21
THX, should look there more often :)
I'm interested in using 'getRGBFrame' as well so
will ask neuron2....
DoC hEx
26th June 2004, 04:11
Well I have it working! With a compiled version of my SampleD2V
I plan to post this newer version which will be called SampleD2V_DG. It will work as the pervious one did except that it now uses the new 'DGDecode.dll' for reading the D2V file.
The only problem is you can't do any kind of real development with this as I've downloaded SP6 of VB and it still has the __cdecl problem. It's only because this new version of the DLL is almost identical to that old, I only had to rename the functions and it worked. But you can’t develop other parts of your app that rely of video! This is a major bummer!!!
If anyone knows how to compile up a test/VB developers version of this DLL with wrapper functions like in the Microsoft example, please could you help us out? As it would mean we could have a local dev version while writing our apps, but just ship the normal one when it came time to let the world see programs.
Cheers!
vion11
26th June 2004, 19:15
If compiled binary does the job it should be possible
to write an activeX wrapper dll with vb for dgdecode.dll and use
this in your sampled2v app.
That would reenable full debugging control.
I'm using this trick to work with the logging feature of vb.
I can't do it, because I didn't get it running
wether compiled or not. :(
DoC hEx
26th June 2004, 21:09
Here check this post out. I've compiled a new version of the DLL for VB development that is 100% with AVS and VB IDE development, so no ActiveX wrap needed. I managed to find all the stuff I needed to compile it, plus my old C++ skills are not as out of data as I thought.
VB Code to Display Mpeg2Dec frame Aspect Ratio, Resizing, Cropping (http://forum.doom9.org/showthread.php?s=&postid=516361#post516361)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.