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 ?
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 ?
First there was God. He was quite lonely, so he created Dennis.
Dennis was unimpressed with God.
So, . . . God created Brian..........Khan Klatt
http://www.clifford.at/fun/GOD
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; }
First there was God. He was quite lonely, so he created Dennis.
Dennis was unimpressed with God.
So, . . . God created Brian..........Khan Klatt
http://www.clifford.at/fun/GOD