Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
485 views
in Technique[技术] by (71.8m points)

.net - How to call a managed function from an unmanaged dll entry point correctly?

I have a working c++/cli project (library) for .Net Framework 4: netefi. It can be successfully converted for support .Net Core 3.1. The library has an entry point: DllEntryPoint (main.cpp).

The debugger (VS2019) stops at the entry point if I put a breakpoint there, but when I try to go to the managed function LoadAssemblies() the host application (Mathcad 15) stops (infinite loop in system libraries). The debugger cannot go there. Ijwhost.dll and runtimeconfig.json also copied to host location.

enter image description here

I tried to create a simple project from a template but got the same result - entry point works but managed code - no. I have not found a similar working example where the entry point is used in a similar way. It looks like the .net core is not initialized.

Environment: VS2019, .Net Core 3.1

Project type: C++/CLI library, x86

Links:

question from:https://stackoverflow.com/questions/65892233/how-to-call-a-managed-function-from-an-unmanaged-dll-entry-point-correctly

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...