From: Chandra P. <cha...@ya...> - 2006-07-12 22:34:41
|
Hi When I use the following sample, I get the following error in C#. Can someone please help. Unhandled Exception: System.EntryPointNotFoundException: Unable to find an entry point named CSharp_CreateSquareBox in DLL example. at examplePINVOKE.CreateSquareBox(Int32 jarg1) at example.CreateSquareBox(Int32 width) in C:\Projects\Phoenix\tools\src\swig win-1.3.27\Examples\csharp\enum\example.cs:line 19 at runme.Main() in c:\projects\phoenix\tools\src\swigwin-1.3.27\examples\csha rp\enum\runme.cs:line 31 But I was able to call getValue from C# that does not have any Box parameters. %module example %ignore Box; // The C# box class must be manually created %typemap(in) Box %{ $1 = $input; %} %typemap(out, null="Box()") Box %{ $result = $1; %} %typemap(cstype) Box "Box" %typemap(imtype) Box "Box" %typemap(ctype) Box "Box" %typemap(csout, excode=SWIGEXCODE) Box { Box ret = $imcall;$excode return ret; } %typemap(csin) Box "$csinput" %inline %{ struct Box { int width; int height; int length; }; Box CreateSquareBox(int width) /*throw (int)*/ { Box b; b.width = width; b.height = width; b.length = width; return b; } int CalculateVolume(Box box) { return box.width * box.height * box.length; }; int getValue() { return 5; } %} I have the following C# class. public struct Box { public int width; public int height; public int length; } Thanks Chandra |