I have created a C# application, having 3 projects:
Here, I have a simple class in C++ project which I am exporting and calling a very simple method of this class from CLI project.
The code builds fine, but once I try to run it, it exits with the following output messages:
The program '[6088] VS2012_ConsoleApp.exe: Native' has exited with code -1073740791 (0xc0000409). The program '[6088] VS2012_ConsoleApp.exe: Managed (v4.0.30319)' has exited with code -1073740791 (0xc0000409).
It works fine if I am creating a class object in the heap. The error is coming if I create static object instance.
// WORKING CODE [Object creation on heap]
NativeClass* cls = new NativeClass();
int returnVal = cls->Add(A, B);
// This code is not working
NativeClass cls;
int returnVal = cls.Add(A, B);
return returnVal;
User contributions licensed under CC BY-SA 3.0