dll problem in C++

Discussion in 'C++' started by st1, May 10, 2007.

  1. st1

    st1 New Member

    Joined:
    May 10, 2007
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    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:
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice