Re: Add dll reference to C# project

"Chris Double" <[email protected]>
Newsgroups gmane.lisp.corman
Message-ID <[email protected]>
On Tue, 11 Mar 2003 17:53:08 -0800, "Roger Corman" <[email protected]>
said:
> You can certainly run it from Visual C++, even from Managed C++ code
> under .NET. However, C++ offers transparent ability to link to Win32 DLLs
> and C# does not. There may be some way to do it but I don't know C# well.

If I recall correctly you need to use a DllImport attribute:

using System.Runtime.InteropServices

class MyClass
{
  [DllImport("MyDll.dll", 
     EntryPoint="FunctionName", 
     CallingConvention=CallingConvention.StdCall)]
  public static extern int FunctionName(int a, int b);
}

Something like that...

Chris.
-- 
  Chris Double
  [email protected]

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get 128 Bit SSL Encryption!
http://us.click.yahoo.com/xaxhjB/hdqFAA/xGHJAA/SyjtlB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, send an email to:
[email protected]

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.