3

Do I have to create a C# DLL to call C++ DLL or I can call it directly from my C# application?

John Saunders
  • 159,224
  • 26
  • 237
  • 393
5YrsLaterDBA
  • 31,368
  • 41
  • 126
  • 205

2 Answers2

7

You can call it directly with PInvoke and the DllImport attribute. Assuming, of course, that it has standard C entry points, not compiler-specific C++ entry points.

Unless you were talking about C++/CLI, in which case you would reference the .NET DLL exactly as you would reference any other .NET DLL.

Mark Rushakoff
  • 238,196
  • 44
  • 399
  • 395
1

You can call a Win32 navite dll directly from your code using P/Invoke.

http://msdn.microsoft.com/en-us/magazine/cc164123.aspx

Michał Piaskowski
  • 3,752
  • 2
  • 32
  • 46