mixed-mode

“The breakpoint will not currently be hit” error while debugging a mixed mode application (c# and unmanaged c++)

落爺英雄遲暮 提交于 2021-02-08 10:44:53
问题 While debugging a mixed mode application in VS2010, the breakpoint set on a line of code contained in an unmanaged c++ dll source file (called from a managed c# wrapper class) shows the infamous "The breakpoint will not currently be hit. No symbols have been loaded for this document" info message when hovering the mouse over the breakpoint on the line in question. The breakpoint itself is a red circle with a yellow info triangle instead of the usual solid red orb. Of course, the breakpoint

C3859: Virtual memory range for PCH exceeded

♀尐吖头ヾ 提交于 2021-01-21 07:25:56
问题 I get this error message from time to time (not every time) I compile (EDIT: sorry, I didn't make myself clear here: I actually meant "rebuild") my mixed-mode project. And Visual Studio tells me to "recompile with a command line option of '-Zm114' or greater". In principle no problem, I just do as VS tells me. But currently, there are two problems with this: Why does it not occur every time I do a rebuild? If I understand correctly, the compiler ran out of memory while compiling my project.

std::array or std::vector from pointer

我的未来我决定 提交于 2020-07-10 07:17:17
问题 I have an array of data in a C++/CLI array that I can pass to a native function using pin_ptr<T> , no problem so far. Now, however, I need to pass the array on to a C++/STL function that expects a container such as std::array or std::vector . The easy way of doing this (which I did first), is to copy element by element. The second-easiest way is to call std::copy() , see the answer to this question: convert System::array to std::vector. However, I want to skip the entire copying step and just

std::array or std::vector from pointer

痞子三分冷 提交于 2020-07-10 07:16:04
问题 I have an array of data in a C++/CLI array that I can pass to a native function using pin_ptr<T> , no problem so far. Now, however, I need to pass the array on to a C++/STL function that expects a container such as std::array or std::vector . The easy way of doing this (which I did first), is to copy element by element. The second-easiest way is to call std::copy() , see the answer to this question: convert System::array to std::vector. However, I want to skip the entire copying step and just

Debugger does not step into native code when debugging a static lib wrapped in a C++/CLI DLL

旧城冷巷雨未停 提交于 2020-02-25 00:51:46
问题 In a C# app, I'm referencing a native C static lib, that I wrapped in a C++/CLI DLL. I chose a static lib versus a DLL because I have other constraints related to the release process of the app to the user. Among the many topics available on this forum I found the following implementation. Main : { MyCLRDLL test = new MyCLRDLL(); if(test.go()) Console.WriteLine("Hello, wrld"); } In the DLL project, the file MyCLRDLL.hpp #include "MyNativeLib.h" #pragma comment(lib, "MyNativeLib.lib")

Debugger does not step into native code when debugging a static lib wrapped in a C++/CLI DLL

百般思念 提交于 2020-02-25 00:51:07
问题 In a C# app, I'm referencing a native C static lib, that I wrapped in a C++/CLI DLL. I chose a static lib versus a DLL because I have other constraints related to the release process of the app to the user. Among the many topics available on this forum I found the following implementation. Main : { MyCLRDLL test = new MyCLRDLL(); if(test.go()) Console.WriteLine("Hello, wrld"); } In the DLL project, the file MyCLRDLL.hpp #include "MyNativeLib.h" #pragma comment(lib, "MyNativeLib.lib")

Linking unmanaged C++ DLL with managed C++ class library DLL

天大地大妈咪最大 提交于 2020-01-14 07:57:09
问题 As in the question Creating simple c++.net wrapper. Step-by-step I am tring to use C++ classes in .NET but I am having problems building in Visual Studio (2008). I have an unmanaged class A (C++ compiled with /clr). I created a C++/clr class 'Class1' which wraps A and with matching method delegates to A's methods. If I include class A's unit source file in the class library project for Class1 (managed) I have no problems everything links and works fine, But I have many unmanaged C++ classes

C#/C(managed2unamanged)Visual studio 2015 update 2 , .NetCore Console App 1.0 , not able to debug Native Code Debugging

天大地大妈咪最大 提交于 2020-01-07 07:43:08
问题 I am using a .Net Core Console App using Visual Studio 2015 update 2 on windows machine. I am using a package "pack1"(managed code) in this console application which in turn calls native / c code dll. I am able to step into pack1 code, but i am not able to step into my native code. Tried giving symbol path to native code pdb file , enabled native and managed code compatibility option,tried putting breakpoint into the native c source code directly, also tried to step into c code from managed

Access violation when running native C++ application that uses a /clr built DLL

独自空忆成欢 提交于 2020-01-04 05:09:51
问题 I'm reorganzing a legacy mixed (managed and unmanaged DLLs) application so that the main application segment is unmanaged MFC and that will call a C++ DLL compiled with /clr flag that will bridge the communication between the managed (C# DLLs) and unmanaged code. Unfortuantely, my changed have resulted in an Access violation that occurs before the application InitInstance() is called. This makes it very difficult to debug. The only information I get is the following stack trace. > 64006108()

Given the choice, what are the pros/cons of mixed-mode assemblies vs. separate interop DLLs?

安稳与你 提交于 2020-01-02 00:27:14
问题 When a 3rd-party component is offered in both "mixed-mode assembly" and "separate interop dll" versions, what are the pros and cons of each? A good example is System.Data.SQLite. The above link has this to say: [Mixed-mode assembly] packages should only be used in cases where the assembly binary must be deployed to the Global Assembly Cache for some reason. But WHY? The mixed-mode assembly seems to work just fine in my projects, with no GAC installation (just xcopy to the application's exe