| Printable Version of Topic
Click here to view this topic in its original format |
| Unofficial VirtualDub Support Forums > VirtualDub Filters and Filter Development > Vb6 - Filter Plugin |
| Posted by: reexre Nov 2 2011, 02:44 PM |
| Hi I developed a picture abstraction filter http://www.youtube.com/watch?v=srFUdEOhWtk&feature=BFa&list=SP2B80AC4C3C4C75A1&lf=list_related The code is written in VB6 I'd like to know how to make a VirtualDub plugin .(and filter dialog) in VB6 Problem is that I don't know nothing about how to build a plugin and that the code is written in VB6. but it should be possible.. isn't it? |
| Posted by: dloneranger Nov 2 2011, 03:15 PM |
| It'd probably be easier to just rewrite the algorithm in c++ so you could use the existing sdk |
| Posted by: phaeron Nov 6 2011, 10:38 PM |
| I did a little research on VB6's DLL capabilities, and I don't believe it is possible to directly create a VirtualDub plugin with it, for two reasons: inability to call functions with __cdecl calling convention, and inability to export DLL functions. You might be able to hack around the latter with the linker, but you would need a C/C++ shim to work around the former. |
| Posted by: reexre Nov 7 2011, 07:54 PM |
| thanks for replaies phaeron and what about VB.NET ? |
| Posted by: MrSmite Nov 10 2011, 06:51 AM |
| Unfortunately Phaeron is correct. There is no easy way to call CDECL functions from VB6 although it isn't too much of a hack to export functions. I've been programming in VB for over 10 years, here are a few things you might find interesting: For calling CDECL, the easiest way is to write a wrapper DLL in C++ that exports STDCALL functions which simply call the CDECL functions. You can then declare/call the STDCALL ones from inside VB. http://support.microsoft.com/kb/153586 For the exporting issue, VB uses the same linker/compiler as C++ but just passes different parameters. Notably, there is no /DEF switch. If you intercept the call and add the /DEF switch, you can supply a DEF file with your exports. There is detailed information here (pages 2 and 3) on writing a proxy linker (easy): http://windowsdevcenter.com/pub/a/windows/2005/04/26/create_dll.html |
| Posted by: phaeron Nov 20 2011, 07:59 PM |
| VB.NET is even less recommended than VB6. You still have to hack the build process in order to export a DLL entry point ("reverse P/Invoke"), but you also have the additional headache of bringing in the .NET Framework and marshaling data between the GC and native heap and potential problems down the line with trying to load multiple versions of the CLR in the same process. |