« Return to Thread: pointer passing between c# dlls and cpp dlls.

pointer passing between c# dlls and cpp dlls.

by Ashish Shete :: Rate this Message:

Reply to Author | View in Thread

Hi,

I have 2 cpp dlls say ACPP.dll and BCPP.dll.
ACPP.dll have following class,

class A
{
public:
    A(){};
    int BlahBlah(){};
};

BCPP.dll has following class,
#include "A.h"
class B
{
    A * Arabic;
public:
    B(A * ar)
    {
        Arabic = ar;
    };
    void MakeMyDay()
    {
        Arabic->BlahBlah();
    }
};

as you can see BCPP.dll is dependent on ACPP.dll.

Now the problem:
I need these two as separate c# dlls in a c# application. I am using SWIG to do this,
I wrap headers for A, and form a ACSharp.dll. Wrapping B should Ideally generate BCsharp.dll. But to wrap B I need to define some typemaps in my .i file for B, in order to let SWIG know that B is dependent upon a class A which is in some other dll.
How can I set the typemap? Please note that I need pointer passing between two C# dlls and C# to cpp dll.
I have done some experimenting with Typemaps. It successfully genearates two separate c# dlls, but when I try to pass c# object of A into constructor of c# object of B, the application crashes. Could anybody please help me to fix this?

Thanks,

Ashish


-- 
Ashish Shete


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Swig-user mailing list
Swig-user@...
https://lists.sourceforge.net/lists/listinfo/swig-user

 « Return to Thread: pointer passing between c# dlls and cpp dlls.

LightInTheBox - Buy quality products at wholesale price