Unmanaged refers to Windows code that is independent of the Common Language Runtime(CLR). COM components, ActiveX components, and Win32 API functions are examples of unmanaged code.
Questions tagged [unmanaged]
1488 questions
193
votes
8 answers
What exactly are unmanaged resources?
I want to know about unmanaged resources.
Can anyone please give me a basic idea?

Deviprasad Das
- 4,203
- 7
- 36
- 51
176
votes
13 answers
What is managed or unmanaged code in programming?
I am using a specific command in in my C# code, which works well. However, it is said to misbehave in "unmanaged" code.
What is managed or unmanaged code?

Pokus
- 11,383
- 11
- 37
- 27
148
votes
5 answers
What is meant by "managed" vs "unmanaged" resources in .NET?
What is meant by the terms managed resource and unmanaged resource in .NET? How do they come into the picture?

Red Swan
- 15,157
- 43
- 156
- 238
146
votes
3 answers
Difference between "managed" and "unmanaged"
I hear/read about it sometimes when talking about .NET, for example "managed code" and "unmanaged code" but I have no idea what they are and what are their differences. What are their difference, by definition? What are the consequences of using…

Louis Rhys
- 34,517
- 56
- 153
- 221
113
votes
6 answers
Marshaling – what is it and why do we need it?
What is marshalling and why do we need it?
I find it hard to believe that I cannot send an int over the wire from C# to C and have to marshall it. Why can't C# just send the 32 bits over with a starting and terminating signal, telling C code that it…
george9170
99
votes
7 answers
Possible to call C++ code from C#?
Is it possible to call C++ code, possibly compiled as a code library file (.dll), from within a .NET language such as C#?
Specifically, C++ code such as the RakNet networking library.
yiingchau
92
votes
5 answers
Embedding unmanaged dll into a managed C# dll
I have a managed C# dll that uses an unmanaged C++ dll using DLLImport. All is working great.
However, I want to embed that unmanaged DLL inside my managed DLL as explain by Microsoft…
Laurent
75
votes
6 answers
What is the difference in managed and unmanaged code, memory and size?
After seeing and listening a lot regarding managed and unmanaged code, and knowing the only difference is that managed is about CLR and un-managed is outside of the CLR, it makes me really curious to know it in detail. What is it all about, managed…

Simsons
- 12,295
- 42
- 153
- 269
71
votes
12 answers
Unmanaged DLLs fail to load on ASP.NET server
This question relates to an ASP.NET website, originally developed in VS 2005 and now in VS 2008.
This website uses two unmanaged external DLLs which are not .NET and I do not have the source code to compile them and have to use them as is.
This…

Werg38
- 1,120
- 1
- 8
- 11
67
votes
4 answers
Difference between native and managed code?
For example, when looking at the GlowCode profiler website it says:
GlowCode 6.2 and x64 profile native, managed, and mixed C++, C#, .NET code
What do they mean?

Joel
- 15,166
- 16
- 39
- 31
61
votes
3 answers
WinApi - GetLastError vs. Marshal.GetLastWin32Error
I tested a lot. But I found no disadvantages of those 2!
But see the accepted answer.
I read here that calling GetLastError in managed code is unsafe because the Framework might internally "overwrite" the last error. I have never had any noticeable…

Bitterblue
- 13,162
- 17
- 86
- 124
50
votes
5 answers
A call to PInvoke function '[...]' has unbalanced the stack
I'm getting this weird error on some stuff I've been using for quite a while. It may be a new thing in Visual Studio 2010 but I'm not sure.
I'm trying to call a unamanged function written in C++ from C#.
From what I've read on the internet and the…

Sanctus2099
- 1,669
- 5
- 22
- 40
50
votes
2 answers
Unmanaged memory and Managed memory
what exactly are un-managed and managed memory?
can anybody explain me in brief?
Also, what exactly would mean when the managed-memory concept is taken to RAM, calling managed-RAM. What are some of the specifics about "managed RAM" and…

Naruto
- 9,476
- 37
- 118
- 201
46
votes
5 answers
Using C++ Class DLL in C# Application
I have an unmanaged C++ DLL which merely exports a single class (not COM...it's just a simple C++ class) as its interface. I want to use this class in C# but am told that it cannot merely be imported into C#.
What is the right way to use this class…

cjserio
- 2,857
- 7
- 29
- 29
44
votes
4 answers
How do I add a reference to an unmanaged C++ project called by a C# project?
One solution (the.sln)
One C++ project (mycppproject.vcxproj in 2010or mycppproject.vcproj in 2008) which compiles a native DLL exporting some function(s). In debug this builds c:\output\Debug\mycppproject_d.dll and in release this builds…

WaffleSouffle
- 3,293
- 2
- 28
- 27