managed-c++

C linkage function cannot return C++ class - error resulting from the contents of my method

你说的曾经没有我的故事 提交于 2021-02-19 02:23:42
问题 I am exporting a method that can be called from unmanaged code, but the function itself lives in a managed c++ project. The following code results in a compiler error: error C2526: 'System::Collections::Generic::IEnumerator<T>::Current::get' : C linkage function cannot return C++ class 'System::Collections::Generic::KeyValuePair<TKey,TValue>' error C2526: 'System::Collections::Generic::Dictionary<TKey,TValue>::KeyCollection::GetEnumerator' : C linkage function cannot return C++ class 'System:

C linkage function cannot return C++ class - error resulting from the contents of my method

≡放荡痞女 提交于 2021-02-19 02:23:21
问题 I am exporting a method that can be called from unmanaged code, but the function itself lives in a managed c++ project. The following code results in a compiler error: error C2526: 'System::Collections::Generic::IEnumerator<T>::Current::get' : C linkage function cannot return C++ class 'System::Collections::Generic::KeyValuePair<TKey,TValue>' error C2526: 'System::Collections::Generic::Dictionary<TKey,TValue>::KeyCollection::GetEnumerator' : C linkage function cannot return C++ class 'System:

_CRT_DEBUGGER_HOOK throws exception

試著忘記壹切 提交于 2020-02-02 03:15:48
问题 I'm having a problem converting my program from VS2005 to VS2008. When I run the program in VS2008, the application starts up fine but when start playing around with the application it crashes giving me this error: "Microsoft Visual Studio C Runtime Library has detected a fatal error" And then the debugger points me to this function: __declspec(noinline) void __cdecl _CRT_DEBUGGER_HOOK(int _Reserved) { /* assign 0 to _debugger_hook_dummy so that the function is not folded in retail */ (

_CRT_DEBUGGER_HOOK throws exception

对着背影说爱祢 提交于 2020-02-02 03:15:11
问题 I'm having a problem converting my program from VS2005 to VS2008. When I run the program in VS2008, the application starts up fine but when start playing around with the application it crashes giving me this error: "Microsoft Visual Studio C Runtime Library has detected a fatal error" And then the debugger points me to this function: __declspec(noinline) void __cdecl _CRT_DEBUGGER_HOOK(int _Reserved) { /* assign 0 to _debugger_hook_dummy so that the function is not folded in retail */ (

Error : Class A uses Class B, which is being defined

末鹿安然 提交于 2020-01-24 13:43:21
问题 I have a C++ project that I've successfully wrapped with .NET classes using C++/CLI. I'm defining the wrapper classes in a .h file. I'm currently getting Error C2460: Mixer uses Track, which is being defined . As you can see in the code below, Mixer uses Track in the var MainTrack and Track also uses Mixer in the var Parent . How do I get these 2 classes linked to each other and compile successfully? #ifndef CPP_MIXER_NET_H #define CPP_MIXER_NET_H #pragma managed // Mixer class public ref

Error : Class A uses Class B, which is being defined

…衆ロ難τιáo~ 提交于 2020-01-24 13:42:09
问题 I have a C++ project that I've successfully wrapped with .NET classes using C++/CLI. I'm defining the wrapper classes in a .h file. I'm currently getting Error C2460: Mixer uses Track, which is being defined . As you can see in the code below, Mixer uses Track in the var MainTrack and Track also uses Mixer in the var Parent . How do I get these 2 classes linked to each other and compile successfully? #ifndef CPP_MIXER_NET_H #define CPP_MIXER_NET_H #pragma managed // Mixer class public ref

AccessViolationException in Release mode (C++)

我是研究僧i 提交于 2020-01-14 15:05:13
问题 I'm getting the following exception when I run my application in Release mode from Visual C++. Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. at _cexit() at .LanguageSupport._UninitializeDefaultDomain(Void * cookie) at .LanguageSupport.UninitializeDefaultDomain() at .LanguageSupport.DomainUnload(Object source, Eve ntArgs arguments) at .ModuleUninitializer.SingletonDomainUnload(Objec t

Asp.net calling C# layer calling Managed C++ calling Native C++

谁都会走 提交于 2020-01-14 13:16:10
问题 My project structure is as follow: ASP.NET calling C# layer calling Managed C++ calling Native C++ (i'm trying to avoid using interop so this is why the managed c++ layer) I wrote unit test that test the C# layer and it works fine. When I try to run the asp.net page i'm getting: "Could not load file or assembly..." error. I figured out that when i copy paste the Native C++ dll to "Temporary ASP.NET Files" (to the corresponding folder) the site works. It seems that the Managed C++ code can