c++ - invalid memory when using classes from a dll -


This is the first time that I have tried to export a class from Dell. What I have done: - Creating an interface (pure virtual methods only) - This interface has been implemented in DLL with a class which is being exported - the class is the method released which is deleted on this pointer - Factory class is created with a static method which gives an indicator in the solid square but as the interface. This class is exported -

The problem is that when I use this DLL in any other project, everything is destroyed. Okay as long as I call the release function on the object. Then it shows a failure window with an "error message" _ASSERTE (_BLOCK_TYPE_IS_VALID (pHead- & gt; nBlockUse); "

Has this happened to someone else? I know that this CD It is as simple to forget to use when you start C ++, but as I said I started it.

Thanks

Is your factory function defined in the header? If it is, and the object is hidden For example, in the new header, and by calling delete from within the DLL, this error may occur

For example, Should appear: MyInterface {Public: Virtual Zero DoSomething () = 0; Virtual ~ MyInterface () {}}; __DesclassPC (Dilexport) MyInterface * __stdcall MyInterfaceFactory ();

MyInterfaceFactory () should be contained within the DLL in the implementation.

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -