[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.sdk

how to call C++ lib file from C#

sunny

7/6/2004 4:53:00 AM


Dear everyone:
I know I can call a dll by c# like this:

using System.Runtime.InteropServices;
[DllImport("user32.dll")]
public static extern int MessageBox(int hWnd, String text,
String caption, uint type);

but now I want to call a lib file created by VC6.0,for example "a.lib".
Could anybody tell me how to do it?
Thanks!

Tom


1 Answer

Klaus H. Probst

7/7/2004 9:06:00 PM

0

Nope. It implies the ability to link statically, and .NET won't do that.


--
Klaus H. Probst, MVP
http://www....


"sunny" <sunny@websharp.org> wrote in message
news:#AGPqRwYEHA.2344@TK2MSFTNGP11.phx.gbl...
>
> Dear everyone:
> I know I can call a dll by c# like this:
>
> using System.Runtime.InteropServices;
> [DllImport("user32.dll")]
> public static extern int MessageBox(int hWnd, String text,
> String caption, uint type);
>
> but now I want to call a lib file created by VC6.0,for example
"a.lib".
> Could anybody tell me how to do it?
> Thanks!
>
> Tom
>
>