I really need a deeper understanding of how to properly set things up in order to get an elegant interaction between my C ++ and C # codebases. What I want to achieve is an in-game editor written in C # for my game engine (C ++ / DX). To do this, I will let VS build my engine as a C ++ dll with some additional functions (unmanaged code) in order to get access to the required functionality of my engine from the C # editor code base. So far so good.
The first thing that bothers me is that I have to build a DLL with CLR support. Otherwise, C # does not accept the DLL for any reason. It doesn’t even allow me to add it to resources ("Link to" C: \ Users ... \ frame_work \ Test \ frame_workd.dll "cannot be added. Make sure that the file is accessible and that it is a valid assembly or COM component . ").
And when I create a dll with CLR support and add it to C # links, re-create without CLR support, start my editor and call the function call from dll, then I get Exception HRESULT: 0x8007007E. I searched for it, but the only thing I found was related to dependencies, but this is not suitable for the warning I get when adding a dll to resources.
Another point is that I always have to switch the configuration type between the application (.exe) and the dll. in VS C ++, depending on whether I want to run my engine directly or from the editor, and every time the whole project is completely created.
So, can someone explain to me how to organize this correctly? And what could be the possible reason C # wants the DLL to be compiled with CLR support?
Thank you guys girls.
source
share