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
4
votes
2 answers

C++/CLI: inherit from one CLR class, multiple C++ classes

In C++/CLI, I want a class hierarchy similar to the following: Foo FooA : Foo, ClrClassA FooB : Foo, ClrClassB Is it possible for FooA to share a (non CLR) base class while also inheriting from separate CLR classes? If not, what would be the…
anthony
  • 40,424
  • 5
  • 55
  • 128
4
votes
3 answers

Convert .Net ref (%) to native (&)

How can I convert a C++/CLI int %tmp to native C++ int &tmp? void test(int %tmp) { // here I need int &tmp2 for another pure C++ function call }
leon22
  • 5,280
  • 19
  • 62
  • 100
4
votes
2 answers

How can you make a C++/CLI DLL resolve a dependency on managed assemblies (DLLs), without using the GAC?

We currently build an ODBC driver as 4 DLLs: A DLL implementing the ODBC (C) API, mostly implemented in C++, with some 'glue' code written in C++/CLI, used to interact with #2, #3, & #4 A DLL containing a managed assembly (written in C#) which…
Bwmat
  • 4,314
  • 3
  • 27
  • 42
4
votes
1 answer

C++\CLI - How to convert UInt64^% to unsigned long long*

I have a C++ function that calculates a buffer size: CalcBuffer(unsigned long long* bufferSize); I want to pass this result into a different function later in my C# code. My C++\CLI Wrapper looks like this: CalcBufferWrapper([Out] UInt64^%…
Itay Gal
  • 10,706
  • 6
  • 36
  • 75
4
votes
3 answers

Creating a Mixed Mode C++ Bridge from C to C#?

I hope someone can help me with this, I'm mostly a C# developer so my C and C++ skills are bad. I have a native C dll that is a plugin of a larger application. I cross compile this dll for windows on linux using gcc. In the native dll when I…
Mike
4
votes
1 answer

Memory debugger for mixed-mode C++ applications

I have to maintain a large C++ mixed-mode application (VC++ 2005, CLR-support: /clr:oldsyntax). I suspect the program has a number of memory leaks but it's hard to find them manually. For native C++ applications we use Purify (and Valgrind on…
user277694
4
votes
1 answer

Disabling .NET handling of native exceptions

I have a C# application that calls a mixed mode C++ dll. I enabled dump generation via HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps. When the dll accesses invalid memory, the runtime converts the win32 exception…
Bruno Martinez
  • 2,850
  • 2
  • 39
  • 47
4
votes
1 answer

How to debug C++/CLI MFC app that crashes before InitInstance

I have this monstrous C++ application built using MFC(mainly) and COM. It links to several libraries and does a lot of scientific computing. So, now I want to add some new features to it and as an organizational policy, we are developing everything…
Aamir
  • 14,882
  • 6
  • 45
  • 69
3
votes
1 answer

Why can't I step into a C++ function from C# in mixed-mode debugging?

I have a C# application that uses an external C++ DLL, and for some reason, I can't step into its functions anymore in Visual Studio. I used to be able to, but now, every time I try, I end up in a disassembly inside NTDLL instead of in my C++…
Sean Werkema
  • 5,810
  • 2
  • 38
  • 42
3
votes
3 answers

Visual Studio 2010 hangs during debugging of C++ / CLI (mixed mode ) projects

After Google the issue i found that it was reported already but nothing useful yet from MS. I wonder if any one found a work around it?
UshaP
  • 1,271
  • 2
  • 18
  • 32
3
votes
1 answer

Native/Mixed-mode dll linking error in vs2010

I am trying to understand how native code can interact with .NET code and am basically trying to implement the example in the answer to this topic. The example code has two parts, one that goes into a .dll compiled with the /clr…
Bernie
  • 286
  • 2
  • 14
3
votes
1 answer

ASP.Net MVC 3 Areas and Mixed Mode Authentication

Is it possible to have an ASP.Net MVC Area use different authentication then the rest of the application? The main app has to be forms authentication since it's an extranet. I need to have an Admin section that is only accessible by internal…
3
votes
1 answer

Debugging embedded Python

I have followed the official Python documentation about embedding & extending the Python runtime. While I have managed to get that to work, I could not figure out how to debug both the c++ and the Python code together. Visual Studio provides an…
Lambda
  • 133
  • 1
  • 13
3
votes
1 answer

HTTPS and HTTP Mixed Content in IE 7 and IE 8

I have an application that I would like to be mostly ssl based but allow http links to coexist on https pages in IE7 and IE8. When I put mixed content (embed http links on https served pages) I get mixed content warnings from IE. Is there any way…
c12
  • 9,557
  • 48
  • 157
  • 253
3
votes
1 answer

C++/CLI mixed mode debugging hangs (Frequently)

I am facing a process hang problem while debugging in mixed mode C++/CLI with a native application. This is unbearable, almost 70% of my debugging this happens and I need to restart the process again and again. Is there any hotfix or solution for…
Usman
  • 2,742
  • 4
  • 44
  • 82