C DLL to C#

alank2

Member
Joined
Jan 10, 2019
Messages
6
Programming Experience
10+
I've build a DLL using C++ and it has this function:

extern "C" __declspec(dllexport) CConfiguration* CFGCreateObject()

I've got it working in C# by using:

[DllImport("cfgfile.dll", CallingConvention = CallingConvention.Cdecl)] public static extern int _CFGCreateObject();

My question is WHY do I have to put in the underscore before it?
 
Back
Top Bottom