hi,
Can I dynamically create an object and return a pointer to that object to the main program from inside a function that is exported from a DLL ?
Printable View
hi,
Can I dynamically create an object and return a pointer to that object to the main program from inside a function that is exported from a DLL ?
Yes.
then why wouldn't this work :
in main.cppCode:
/* class A is an abstract class */
class A
{
}
class B: public A
{
}
if I just returned a NULL, this would work ( with some other error message), but if I do it like this it will give me "Run-Time Check Failure #0- The value of ESP was not properly saved across a function call. This is usually a result of calling a function ............"Code:A* __declspec(dllexport) get_A()
{
A* a =new B();
return a;
}