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
6
votes
1 answer

unmanaged var as member of managed class c++

I'm novice in .net c++ and trying to create class looking like: public ref class Klient { public: Klient(){} // zmienne static DWORD klienty[41][2]; static int i = 1; static DWORD* pid; static HANDLE* handle; …
Luke
  • 2,350
  • 6
  • 26
  • 41
6
votes
2 answers

Losing anti aliasing when sharing Graphics object between managed and unmanaged code

Passing Graphics object between native C++ and C# I'm currently working on a Paint .NET-like application. I have mulitple types of layers which are implemented in C#. These layers are drawn into a .NET Graphics object that is provided by a WinForms…
barnacleboy
  • 539
  • 8
  • 18
5
votes
2 answers

Accessing Assembly language from C++

This is my programming assignment. I need to find out the largest among the array of integers using a method written in 8086 programming language. This is my attempt : #include #include int returnLargest(int a[]) …
Kameron
  • 703
  • 3
  • 10
  • 23
5
votes
0 answers

How to enable mixed mode debugging in Visual Studio Code?

I have a C#.NET Core Web application that uses some C++ code for certain operations. This web application is running on Cent OS 8. (I am a Windows Developer and working on Linux for first time and so with VSCode) I only have the option to debug…
5
votes
1 answer

Unable to debug native code from managed despite enabling native code debugging

I have a managed project (.net 4.6.2) which calls into a native dll. If I put a breakpoint in the native code, it hits it, but if I try to inspect stack variables I get a rather annoying Inspection of unmanaged type 'MyTypeInHere*' requires…
friartuck
  • 2,954
  • 4
  • 33
  • 67
5
votes
6 answers

Visual Studio: Garbled debug watch of std::string's?

When I'm debugging C++ mixed (managed/unmanaged) projects in Visual Studio 2005, I often get weird data from the debug watches, like below : (btw, the variable i_processName is a const std::string & ) alt text…
Cristian Diaconescu
  • 34,633
  • 32
  • 143
  • 233
5
votes
2 answers

Managed code references between any cpu and x64

I have a mixed-mode C++/CLI project which is compiled as x86 and x64 frozen dlls. I have a C# app that needs to use this project which is compiled as "Any CPU". How can I properly reference the correct dll from the c# app? If I right click add…
CSharpMan
  • 53
  • 3
5
votes
1 answer

How can I debug into an unmanaged BCL (InternalCall) method?

I want to debug into the implementation of a [MethodImpl(MethodImplOptions.InternalCall)] BCL method, which is presumably implemented in C++. (In this particular case, I'm looking at System.String.nativeCompareOrdinal.) This is mainly because I'm…
Joe White
  • 94,807
  • 60
  • 220
  • 330
5
votes
0 answers

useLegacyV2RuntimeActivationPolicy="true" does not work with .NET 4.5

The Top answers here: What does 'useLegacyV2RuntimeActivationPolicy' do in the .NET 4 config? and What 'additional configuration' is necessary to reference a .NET 2.0 mixed mode assembly in a .NET 4.0 project? did not help. My particular Use-case is…
Charles Okwuagwu
  • 10,538
  • 16
  • 87
  • 157
5
votes
0 answers

C++/CLI: #pragma managed / unmanaged scope

I have a mixed-mode DLL, and a .cpp file in it with both managed and unmanaged code. A simplified repro example looks like this: #include "stdafx.h" #pragma managed // Just for explicitness (doesn't influence results) #include…
nevermind
  • 2,300
  • 1
  • 20
  • 36
5
votes
1 answer

.NET application loading mixed dll, using Any CPU

I am new to creating .NET applications, esp mixed applications. Recently I have created a set of (static) libraries for a client in (unmanaged) C++ (under MS Visual Studio 2010), supporting both 32-bit and 64-bit compiles, which were loaded by some…
Bjoern
  • 633
  • 6
  • 16
5
votes
2 answers

Standard conformant way of converting std::time_t to System::DateTime?

I have already found several answers related to converting a std::time_t value to System::DateTime and back. However, almost all answers seem to neglect that the type of std::time_t is actually undefined in the standard. Most solutions just cast…
Excelcius
  • 1,680
  • 1
  • 14
  • 31
5
votes
1 answer

friend ref class?

I have a managed class Parser and an unmanaged class CParser. The former is exposed from a DLL for managed clients (C# world). The core functionality is in the unmanaged class CParser. Since both are in the same DLL, and there is a one-to-one…
Ajay
  • 18,086
  • 12
  • 59
  • 105
4
votes
2 answers

How do I display a mixed mode assembly's version number is windows explorer?

Is there a way for the assembly/file version of a mixed mode assembly to be displayed in windows explorer? I'm trying to investigate some versioning issues and it would be much quicker if I could just glance at the version numbers of assemblies.
Akash
  • 2,311
  • 1
  • 20
  • 37
4
votes
1 answer

How to create mixed managed/native C++ dll in VS2010?

I want to create a dll which has a managed C++ interface, but the actual code working underneath is native C++. Currently we are using COM (STA) to interface with the managed code, but now we want to call the module with ThreadPool, which will not…
Walter Williams
  • 944
  • 3
  • 11
  • 25
1 2
3
16 17