![]() |
|
#1
|
|||
|
|||
Non-local heaps and assertion errorsHello,
I am developing an application that makes use of rather advanced memory allocation techniques. My application makes use of "plug-in modules" in the form of DLLs that are loaded at runtime. The problem is this: the DLL exports a function that is passed a pointer to a class. This pointer is passed by the application. Now, the DLL must be able to call a member function, accessed through the passed pointer. This function allocates memory. Whenever this function is called, though, the application generates an assertion failure. I looked at the MFC code and found that an assertion error will be generated if it encounters a pointer to non-local memory - which is clearly the case here. How can I work around this? Thank you, marius. |
|||
|
#2
|
||||
|
||||
|
Quote:
Don't you mean a pointer to an instance of the class (an object)? Well, do you instantiate the class the pointer is pointing to? If you want to call a (non-static) method, you should have an instance of the class, right? Just "export" this class from the dll also, make an instance of it, and pass a pointer to it. Hope I got this right - if not, please explain. Best regards, Luci __________________
Please read these Guidelines before posting on the forum "A person who never made a mistake never tried anything new." Einstein |
Recent GIDBlog
Accepted for Ph.D. program by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The