NP, I struggled with these problems too so happy to share the stuff I've learned about it.
1. You just need to export CreateInterface/DestroyInterface routines from your Delphi made dll, such as I outlined above.
2. You need to dynamically load this DLL on the c++ side (use LoadLibrary) and bind to these two routines.
3. Define the interface class on the C++ side and pass a pointer to this class to CreateInterface:Note: You need to define the aObj as a pointer to a pointer (CreateInterface(int aIID, void **aObj); )because you need the modified pointer on return.Code:CMyClass *myclass; // create object instance CreateInterface(0, &myclass); ... // destroy object when your done DestroyInterface(&myclass);
Bookmarks