calling unmanaged c++

  • Thread starter Thread starter Jacob Gladish
  • Start date Start date
J

Jacob Gladish

Can someone provide a small snippet of how to call unmanaged c++ from within
a c# application. The code is in a .lib file, and not in a .dll. Can you
include headers in c# !!???
 
Even for a dll file, if not a COM, can we use it in C#? If we could,
is there any sample project which show the way to do it? Thanks
 
chrisben said:
Even for a dll file, if not a COM, can we use it in C#? If we could,
is there any sample project which show the way to do it? Thanks

I have a managed C++ class that calls AdjustTokenPrivileges, from the
MS Win32 call list.
I just use (my namespace is ACLabLoginUtil)
using ACLabLoginUtil

and that allows my C# program to use the C++ functions.

I had to include the file in my project though, as a reference, but
that was it.
 
Back
Top