How to export a C++ class library to C# using a dll?

Posted by SICGames2013 on Game Development See other posts from Game Development or by SICGames2013
Published on 2013-11-12T01:01:37Z Indexed on 2013/11/12 10:24 UTC
Read the original article Hit count: 251

Filed under:
|
|
|

In my previous revision game engine I deported major functions for the game editor for C#. Now, I'm beginning to revise the game engine with a static library. There's a already dynamic library created in C++ to use DLLEXPORT for C#. Just now I want to test out the newer functions and created a DLL file from C++. Because the DLL contains classes I was wondering how would I be able to use DLL Export. Would I do this:

[DLLEXPORT("GameEngine.dll", EntryPoint="SomeClass", Conventional=_stdcall)]
static extern void functionFromClass();

I have a feeling it's probably DLLImport and not DLLExport. I was wondering how would I go about this? Another way I was thinking was because I already have the DLL in C++ prepared already to go the C# Class Library. I could just keep the new engine as a lib, and link the lib with the old DLL C++ file.

Wouldn't the EntryPoint be able to point to the class the function is in?

© Game Development or respective owner

Related posts about c++

Related posts about c#