Using #pragma Directives

You need to use the /clr compile option.  /clr:safe will generate all sorts of errors. You can’t call managed code from the unmanaged code. #pragma unmanaged #pragma managed

Read More

P/Invoke (Platform Invoke)

System::Runtime::InteropServices Chapter 22/23 of the ‘Pro Visual C++/CLI and the .NET 3.5 Platform’ book is an excellent resource for understanding P/Invoke (and an excellent VC++ book generally). Used when making calls out of the .NET managed environment to unmanaged .DLLs. P/Invoke finds the DLL, loads it into memory, marshals its arguments (converts from managed to […]

Read More