From: Ashish S. <Ashish.Shete@ProtoTechSolutions.com> - 2008-03-28 14:38:52
|
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 |