0

Possible Duplicate:
Possible to call C++ code from C#?

Many years ago I did develp in C++ using Visual Studio 6. Nowdays, I should writing a simple console application in order to call some dll function written in c++. Note that none of that functions are exposed in .NET world, so I cannot write any wrap, instead I just need to remeber something about c++.

The first thing I got in my mind is how to call (in .net, referencing) native dll. Is it accomplished simply by "using ddlFilePath" instruction?

Finally, but not less important, wich are essential differents between C++ console app created with Visual Studio 6 and C++ Console app created with Visual Studio 2010?

Community
  • 1
  • 1
bit
  • 934
  • 1
  • 11
  • 32
  • http://msdn.microsoft.com/en-us/library/aa288468(v=vs.71).aspx – Robert Rouhani Sep 25 '12 at 18:08
  • 1
    You don't include .dlls in C++ applications by adding "references". (Unless it's C++/CLI). – Janman Sep 25 '12 at 18:10
  • No. I can't call C++ from C# because C++ function aren't exposed on external world. Just I'd like to know how to call c++ dll functions from c++ console app. – bit Sep 25 '12 at 18:20

2 Answers2

1

Please look at this similar question: Using .dll in Visual Studio 2010 C++ The first answer is very well written (I think)

The essential difference between C++ programs written in Visual Studio 6 and programs written in Visual Studio 2010 is the improvement and syntax change in the C++ language. The language should be backwards compatible, so programs written in Visual Studio 6 should compile in Visual Studio 10 (but not the other way!)

Community
  • 1
  • 1
Janman
  • 698
  • 1
  • 9
  • 25
0

To use a non-COM DLL in .NET, you have to use Platform Invoke.

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770