Welcome to PGD
If this is your first visit, be sure to check out the FAQ by clicking the link above. You have to register before you can post.
If you have recently signed up, please make sure you log in so that your activity is registered. This is required for automatic promotions to work and to ensure your account is not deleted during the registration process.
AthenaOfDelphi
Originally Posted by Pyrogine 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: Code: CMyClass *myclass; // create object instance CreateInterface(0, &myclass); ... // destroy object when your done DestroyInterface(&myclass); 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. Here the code only compile with a single *, and works nice
CMyClass *myclass; // create object instance CreateInterface(0, &myclass); ... // destroy object when your done DestroyInterface(&myclass);
From brazil (: Pascal pownz!
Forum Rules
Bookmarks