Questions tagged [mixed-mode]

A mixed-mode application is any application that combines native code (C++) with managed code (such as Visual Basic, Visual C#, or C++/CLI that runs on the common language runtime).

From MSDN:

A mixed-mode application is any application that combines native code (C++) with managed code (such as Visual Basic, Visual C#, or C++/CLI that runs on the common language runtime).

Mixed assemblies are capable of containing both unmanaged machine instructions and MSIL instructions. This allows them to call and be called by .NET components, while retaining compatibility with components that are entirely unmanaged. Using mixed assemblies, developers can author applications using a mixture of managed and unmanaged functionality.

249 questions
0
votes
0 answers

C++/CLI object gets finalized even though an object holds a gcroot handle on it?

I try to hold a singleton C++/CLI object from a native object which is held by another C++/CLI object which is held by the C# App. TestGcroot::App (C#) -> Class1 (C++/CLI) -> Class2 (native) -> Something (C++/CLI) ClassLibrary1::SharedSomething…
George S.
  • 613
  • 5
  • 11
0
votes
0 answers

Mixed mode deployment

I have a Visual Studio solution with mixed mode. Some projects are .Net Framework 4.0 while others are .Net Framework 2. This was solved by adding an app.config with:
0
votes
1 answer

Assign value to C# enum from C++/CLI const

I've searched through the other answers similar to this topic, but haven't found anything completely relevant. I'm trying to assign values to some enumerations in C#, using values that are marked as static const in a C++/CLI file, which are…
Hamo2k1
  • 3
  • 3
0
votes
1 answer

Global variables not destructed in main thread?

I have a mixed-mode executable and I noticed that the constructor of my native global variables is called in the main thread, but the destructor is called in some other thread. The name of thread is 'Thread::intermediateThreadProc'. What is the…
eli
  • 662
  • 8
  • 18
0
votes
1 answer

Ampersand Operator in Mixed Managed/Unmanaged C++/CLI Project

In writing a function within a C++/CLI ref class, I wish to pass a pointer to a pointer to an object when calling a native function. Native Function void MyNativeFunc(NativeObject** obj); Managed C++/CLI Function ref class ManagedType { static…
Russell Trahan
  • 783
  • 4
  • 34
0
votes
0 answers

C++\CLI mixed mode DLL

I've a native C++ DLL that I want to convert into a managed DLL using the C++\CLI mixed-mode feature. I've written some code. The compilation of the DLL is fine, but the compilation of the executable that exploits the DLL fails with the error…
WestWizard
  • 51
  • 7
0
votes
0 answers

OpenCV: Error creating a gray Mat

I'm using OpenCV 2.4.10 in a 32-bit C#/C++ application, I feed Bitmaps (which were taken from videos, they are in memory) from C# to C++/OpenCV using a C++/CLI wrapper and it works fine in my PC and some other machines, but I'm having issues on a…
Eric Omine
  • 489
  • 4
  • 15
0
votes
1 answer

Storing native data in C++/cli without using new

I'm trying to write a thin wrapper (of very little functionality that i actually need) around OpenCV 3 in C++/CLI to be consumed from C#. However i'm not quite figuring out how i can store my Mat variables in the managed class, if i try to do it as…
Ronan Thibaudau
  • 3,413
  • 3
  • 29
  • 78
0
votes
1 answer

Convert a mixed mode application project (.exe) to a mixed mode dynamic library (.dll)

I have a project containing both native and managed C++ code. Its runtime support is set to /clr. Its configuration type used to be set to Application, such that it compiled to an .exe. This worked all fine. But now I want to use this project as a…
chtenb
  • 14,924
  • 14
  • 78
  • 116
0
votes
1 answer

Targeting .net framework 3.5 and 4.0 with mixed mode assembly

i have a mixed mode assembly that targets .net 3.5 using the vc 9.0 runtime. i do wan't to support .net 4.0 yet still remain compatible to the old framework as well (the library should work for 4.0 and for 3.5 processes). if i update to .net 4.0 i…
y2uk
  • 1
0
votes
2 answers

Managed to unmanaged callback with managed parameters?

My callback in unmanaged C++ is this: typedef void (*ErrorCallback)(OutputLog& log, std::string& message); It's usage (code is simplified): class OutputLog { private: ErrorCallback _callback; public: void Error(std::string& message) …
0
votes
1 answer

C++ wrapper pass pointer address to native class

Hello I am trying to pass a pointer address from a managed class to an unmanaged class. So every A-Object has a reference to a B-object. But if I pass the reference in _a = new A(_managedB->_b) the compiler throws an error that no constructor…
Franki1986
  • 1,320
  • 1
  • 15
  • 40
0
votes
1 answer

Stepping into the break point when using Win32 thru a CLI Wrapper in a C# .NET Application

I have the following solution structure: Project Files 1. Win32 C++ DLL 2. CLI/C++ Wrapper DLL 3. WinForm C# Exe 4. MFC Tester Exe When I access the Win32 using the following stucture: WinForm => CLI Wrapper => Win32 DLL I can debug the WinForm…
Nap
  • 8,096
  • 13
  • 74
  • 117
0
votes
0 answers

What is the simplest way to create a Mixed (Native and Managed) Assemblies using Visual studio 2013

I have an assembly which I guess is built in x64 and I want to reference that in a project with Any CPU configuration. But When I reference that .net assembly to the prject with Any CPU platform, I get the following warning warning MSB3270: There…
VivekDev
  • 20,868
  • 27
  • 132
  • 202
0
votes
0 answers

Property of interface implemented by c# class not accessible from c++/cli

I'm trying to implement a native interface in C++/CLI, to a class developed in c#. I'm using VS2013. Here's a simplified version of the C# class: namespace ManagedTypes { public static class CaptureFile { public static IPacketList…