Note that by default, visual studio will not copy your own output to the same folder as your managed output.
manually copy your own output to the managed assembly folder and try again - if this is your problem, you need to change the C ++ assembly settings to set the destination folder in the same way as the managed application folder.
Your code is correct - as long as the QUERYSEGMENTATION_API macro is defined correctly and your dll is actually built as "MyApplication.dll"
I would manually execute the executable from the file system - make sure that the latest exe and dll are in the same folder, and if it does not work, run the depend.exe file to understand this.
source share