access visual c++ functions from visual c# project

catalin

New member
Joined
May 29, 2003
Messages
1
Hi,
i created a visual C# project(windows application) and i added an existing project (a visual C++ project). The project in c++ is actually a library with a lot of functions and structures.

Now, i dont know how to access the functions in c# from the c++ project.
An ideea was to include a lib file in the c# project (windows application), but i dont know how.
Another ideea was to make a dll file and include this one in the c# project. The problem is that all the functions have as parameters structures defined in that lib/dll file (and i dont know how to access them).

Please, help me with a solution on how to resolv this problem.

Thanks
 
Is that a managed C++ dll?
If yes then in your C# project go solution explorer, expand your project, and go to references and browse for your dll and add it.
 
Is that the terminator, mutant?

I am pretty sure you can put something like this above your unmanaged c++ function:
[DllImport("user32.dll")]
"Your function goes here"
 
Back
Top