pure virtual c++ function wrapping 1.3.339

View: New views
1 Messages — Rating Filter:   Alert me  

pure virtual c++ function wrapping 1.3.339

by xmueller :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

hello,
i have a big problem.
i have dll that is to be wrapped for perl, python, etc.
for this DLL, i have a c++ wrapper which is included in my swig projects for perl, python,etc

if this c++ wrapper is not inherited, all works fine.

for some reason, i have to inherit this c++ DLL wrapper:

class CDLLWrapperBase
{
   virtual int Init(int x)=0;
};

and for my perl project

class DLLWrapperForPerl : public CDLLWrapperBase
{
   int Init(int x);
};

with base class, like defined above, the resulting perldll fails to load.
i read elswhere, that pure virutal functions are not wrapped. ok.

Now,i do this:
class CDLLWrapperBase
{
   virtual int Init(int x){return 0;}
};

now, when loading the perldll, only the base member is called.

not so when using the same wrapper in a c++ project.
in this case, Init from derived function is called, as it is correctly.

i need either a solution that allows wrapping classes with pure virutal functions
or a solution that finally calls inherited function.

can anyone help me ?

thank you