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
6
votes
2 answers
Using unmanaged code from managed code
I have my project developed in MFC which is unmnaged code. Now i need to create a similar application in C#, by reusing most of the MFC classes.
Is it possible to directly export class/struct/enum from MFC dll, so that i can import it in my C# using…

Harsha
- 183
- 2
- 8
6
votes
2 answers
Passing c# string to unmanaged c++ DLL
I have a simple application that loads an unmanaged dll and passes a few string values to it from C#. But in the C++ dll application, I receive an exception :: Tried to access a read/write protected memory. My DLL Import looks like…

Prabhu
- 3,434
- 8
- 40
- 48
6
votes
6 answers
How to wrap a C library so that it can be called from a web service
We have a library with very complex logic implemented in C. It has a command line interface with not too complex string-based arguments. In order to access this, we would like to wrap the library so that it can be accessed with simple XML RPC or…

Kariem
- 4,398
- 3
- 44
- 73
6
votes
1 answer
Is it possible to run Native C++ code in Windows Azure?
I have an application written in native C++ which intends intensive computation. In fact I'm interested only in result of computation, i.e. it can be done without GUI or be controlled by some .Net service/application.
Can I run it in Microsoft's…

flashnik
- 1,900
- 4
- 19
- 38
6
votes
3 answers
My application is unmanaged. Where do I start introducing managed code?
My whole application (which is rather big, with a 20MB executable) is written in unmanaged C++.
Because I can clearly see the advantages in using managed code, I want to start introducing managed code in my application, but where do I start?
Can I…

Patrick
- 23,217
- 12
- 67
- 130
6
votes
3 answers
Unmanaged C# versus C++
I am a wanna-be Games Developer and I prefer using C#. When I asked what the disadvantages of writing real-time applications in C# were I got 1 significant point back: Garbage Collection and the unpredictable impact it can have on performance.
My…

Sellorio
- 1,806
- 1
- 16
- 32
6
votes
1 answer
GCHandle, AppDomains managed code and 3rd party dll
I have looking at many threads about the exception "cannot pass a GCHandle across AppDomains" but I still don't get it....
I'm working with an RFID Reader which is driven by a DLL. I don't have source code for this DLL but only a sample to show how…

hurtauda
- 63
- 5
6
votes
2 answers
How do I find the source of a "A procedure imported by 'xxx.dll' could not be loaded." exception?
I have been chasing this exception for the past week.
Situation is:
I have an application that is written in C# and built in Visual Studio 2010.
The application includes a DLL that is a wrapper of an unmanaged code library.
The unmanaged code is…

user1542042
- 195
- 1
- 9
6
votes
3 answers
C++ Access to command line arguments outside main?
I have a couple command line apps that both end up calling into com objects. Rather than adding new interface to these com objects, can they access the parameters passed from the command line?
Edit: Sort of how I can call GetModuleFileName to get…

Kyle
- 17,317
- 32
- 140
- 246
6
votes
2 answers
Marshaling a Byte array to a C# structure
I'm working on a C# project for reading FAT32 Boot Sector and BPB, The problem is that I'm using a marshaling mechanism to convert a byte array to a Custom FAT32 data structure.
I get a message error saying :
Could not load type…

Waleed
- 3,105
- 2
- 24
- 31
6
votes
1 answer
C# application with unmanaged DLL freezes whole system
I'm currently writing a software in Visual Studio 2012 for communication with RFID-cards.
I got a DLL written in Delphi to handle the communication with the card reader.
The problem is: My software is running fine on machines, that have VS2012…

deR_Ed
- 528
- 4
- 15
6
votes
1 answer
Why is Marshal.DestroyStructure considered Pure?
Marshal.DestroyStructure is marked with the Pure attribute in the .NET Framework but I'm unsure as to why when it clearly has an effect on the context calling it.
The state is modified (the pointer is freed) even if it doesn't directly modify the…

Rushyo
- 7,495
- 4
- 35
- 42
6
votes
2 answers
Passing a pointer to class into unmanaged c++ code from C#
I have a c++ exported function in dll:
int MyMethod(ulong pid, MyStruct* struct);
MyStruct is described as class:
class MyStruct
{
public:
uchar nVersion;
uchar nModuleType;
uchar nMachine64;
uchar nReserved;
ulong data1;
ulong …

Denis Kildishev
- 709
- 2
- 7
- 15
6
votes
1 answer
How to find a list of all unmanaged DLLs loadad by my managed .net application
My managed .net application uses third party .net libraries, which use (via PInvoke) unmanaged dlls. I would like to find out, which dlls are loaded. I tried to use "Process Explorer" and "Dependency Walker", but I can only see the managed DLLs.

Gerhard
- 1,342
- 2
- 12
- 23
6
votes
5 answers
Dispose pattern: How do I know what's managed and what's unmanaged?
Reading about the Dispose pattern, I see the documentation repeatedly refer to "cleaning up managed and unmanaged code". And in the canonical implementation of the Dispose method, I see specific flows (depending on whether disposing is true or…

Jeff Stewart
- 803
- 1
- 8
- 14