Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C++ (http://www.go4expert.com/forums/cpp/)
-   -   dll problem in C++ (http://www.go4expert.com/forums/dll-cpp-t4258/)

st1 10May2007 11:27

dll problem in C++
 
Hi all!
i'm a newbie in this forum...and i find it very cool!
So, i'm not an experienced C++ developer and I'm messing around with some dlls:
so here's a problem I have encountered:
in a project I have a base class BC (say private members are x,y) and a derived class DC (say private members are x,y,z) which inherits from the previous class. I also have a function foo in another cpp file which I want to export it to Excel through a dll. In the body of the function foo, I construct and initialize an object DC(x,y,z). Everything works fine if I run this function in C++...inheritance works as expected. But when I try to run it from Excel using the constructed dll, it seems as if the private members x,y were never initialized, while z is correctly initialized!!! (in fact I figured that out by making the function FOO output x,y,z in Excel; z comes out correctly, but x,y come out as 1376260, which of course has no relation to the value they were initialized) So, do you have any ideas about how to resolve the problem?

Best,

steven :confused:


All times are GMT +5.5. The time now is 16:15.