Any way to access a C++ DLL?

mike vertex at gmx.at
Wed Sep 6 04:03:40 PDT 2006


Hi!

Lot's of questions coming up ... but that's really important for me, if I  
can't solve that I have to throw away over half a year of invested spare  
time, so:

Is there any way to access a C++ DLL (precisely: a VST plugin - for those  
who don't know: VST is a plugin API for virtual synthesizers, audio/midi  
effects, etc.) from D?

I'm working on a VST host in D. I knew that VST plugins are written in  
C++ but I somehow had in mind that the VST SDK just maps the C++ objects  
to C functions ... now I found out that I was terribly wrong - a VST  
plugin host obtains a pointer to a C++ object from the DLL's main and  
calls that for processing. So ... is there a way to wrap that with a D  
class?

Since I'm not really experienced with plugins and calling conventions and  
that ... my guess is that there's the vtbl somewhere stored in the DLL,  
one can calculate entry points for every member of the class from that and  
needs to possibly push a this ptr on the stack before calling the function  
pointer. Is that correct and doable? With a little research I'm sure I can  
make it work, but I would like to ask the experts here if it's at all  
possible or if I should rather think of something else.

-Mike

-- 
Erstellt mit Operas revolutionärem E-Mail-Modul: http://www.opera.com/mail/



More information about the Digitalmars-d mailing list