Hi Brian,
I had problem like yours (topic"Memory Leak when using DllImportAttribute").
I suppose that one trick can help you to fix your problem.
Try to create separate class with private constructor and declaration of
your static imported function.
Regards,
Kanstantin.
> Hello,
>
[quoted text clipped - 23 lines]
>
> Is there a trick to tell C# to stop going wild ?
Brian Anderson - 27 Dec 2004 11:51 GMT
The problem is found:
Fixed C# code:
[DllImport("pac.dll")]
public static extern int main(int argc, string[] argv);
string[] be = { "CHunter.exe", "-1", "Test.paq", "Test.txt" };
int handler = Class1.main(be.Length -1, be);
The trick was to add the name of my C# application ["CHunter.exe",] that
calls the C++ Dll through DllImport.
Now the RAM-Leak is gone.
---
> Hi Brian,
> I had problem like yours (topic"Memory Leak when using DllImportAttribute").
[quoted text clipped - 32 lines]
> >
> > Is there a trick to tell C# to stop going wild ?