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
-1
votes
1 answer
.NET app exits with exception 0xe0434352 assembly load failed but which one?
I have a .NET 4.0 app created with VS2012 that runs fine on my development system. It has several unmanaged DLL's both from 3rd party and also written by me. All these DLL's are in the same folder with the .NET app.exe. A remote customer however…

JonN
- 2,498
- 5
- 33
- 49
-1
votes
1 answer
Is FreeHGlobal() required to free unmanaged string passed in a function?
If I have the following piece of code :
void foo (String^ v)
{
WCHAR someString[256];
_tcscpy_s(someString, (LPCTSTR)Marshal::StringtoHGLobalUni(v).ToPointer());
}
Would I still need to use FreeHGlobal() in this case? And if so, why? Would…

user1173240
- 1,455
- 2
- 23
- 50
-1
votes
1 answer
LPBYTE as an array of specific length
I need to import a C-function which is descripted as
int Read(LPBYTE data, LPBYTE lengthOfData);
The documentation says the following:
data
[out] data which was read
lengthOfData
[out] length of data which was read
And there is the…

EngineerSpock
- 2,575
- 4
- 35
- 57
-1
votes
1 answer
How can i get a pointer to an array of unknown type?
So if i have code like this:
public static void GetPointer(int[] array)
{
fixed(void* pointer = array)
{
}
}
I can take a pointer of unknown type of an int array very easy. But what if i want to take a pointer of an array of unknown…

Eugen1344
- 165
- 3
- 17
-1
votes
1 answer
Can not catch assert call from native dll in .NET
I am using one function from native .dll in C# code and sometimes the following assert is calling:
#include
...
assert(e > 0.0);
But I can not catch it in my .NET application (it's just crashing). How can I handle this?

Ivan Kochurkin
- 4,413
- 8
- 45
- 80
-1
votes
1 answer
.Net mixing unmanaged x32 and x64 dlls
I have a dependency on an unmanaged dll.
I can compile the unmanaged dll in both x86 and x64.
I want to add my project both the x64 and x86 dlls, so it could dynamically choose between the x64 or x86 dlls depend on the system environment…

Yogev
- 141
- 4
- 14
-1
votes
1 answer
P/Invoke and memory related intermittent crash
I've implemented this APIs some time ago and everything was working quite well until some weeks ago when I noticed it, The intermittent crash, the famous Marshaling related in .NET "Attempted to read or write protected memory. This is often an…

Allegro07
- 1
- 1
-1
votes
1 answer
C++ function trigger C# function
Basically my code is looks like below
Managed.dll
Managed.cs
class MyManagedClass
{
public ShowMessage()
{
System.out.println("My Message");
}
}
Wrapper.dll
ref class Wrapper
{
};
Native.lib
class NativeClass
{
public:
void…

ravikumar
- 89
- 1
- 1
- 3
-1
votes
1 answer
Why is taskkill hanging when called from c# code?
Taskkill is (ironically) hanging when I call it from a c# library to clear WerFault.exe processes
I'm trying to use taskkill to close WerFault processes that are spawned duriung a load test running from nunit. The WerFault.exe is created whenever an…

Dave00Galloway
- 609
- 1
- 6
- 20
-1
votes
1 answer
Unamanged DLL speed varies when whole solution is loaded
I'm calling an unamaged 32bit-C++ library from a 64bit C# project. To test my methods and the functions of the library I created a rather simple wpf project. Using the test projects the library calls are handled pretty fast, so everything is…

DIF
- 2,470
- 6
- 35
- 49
-1
votes
2 answers
C# Call to unmanaged Delphi DLL returns a partially corrputed structure
I'm having some issues where data in a structure that I pass to an unmanaged DLL written in Delphi (version unknown) seems to be getting corrupted. Would someone please do a sanity check on my code.
The project is build with VS2012 targeting the…

MincedMeat
- 1
- 2
-1
votes
1 answer
Unmanaged Dll call und Pinning of Managed Objects
I have three unmanaged dll functions:
void Init(){}
void Run(){}
void Done(){}
They work with the same managed object. Init() function inits the object, Run() uses it and Done() clears it.
My main question is: Is it necessary to use…

Creator
- 135
- 11
-1
votes
1 answer
how to automatically dispose managed and unmanaged objects on fromClosed event?
i am improving speed and resource usage of an huge HIS application that have more than 200 winForms and they use entityContext like these :
private void someMethod()
{
var context = new entityContext();
var qry =…

patachi
- 315
- 1
- 2
- 18
-1
votes
3 answers
Combo box inside of list control? (Unmanaged C++)
I'm using unmanaged C++ and I was wondering if I could embed a combo box inside a column of my List View. I have tried googling for information, however I keep finding C# articles on the subject.
It seems like the LVCOLUMN's mask can support text…

Kyle
- 17,317
- 32
- 140
- 246
-1
votes
4 answers
Getting started with unmanaged Windows application?
The app I am thinking about is something like an email reader (UI intensive). Is MFC the best/only way to go? Are there any other development environments for this other than Visual Studio? Are there any recommended/must read for this?

user92454
- 1,201
- 1
- 10
- 13