unmanaged

Using C++ Class DLL in C# Application

Hello, 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 in my C# application? ...

Passing Unmanaged pointers in C++/CLI

I'm creating a C++/CLI wrapper DLL that depends on numerous C++ static libraries. Some of the function calls expect unmanaged pointers to be passed in. How do i pass them properly? Also, other functions expect a "this pointer" to be passed in as a void*. What's the right way to pass "this"? Here's my class definition... public ref cla...

Getting at unmanaged C++ functions from C#

I have some ANSI standard C code which is authoritative. What that means is that although I have the source, I can not translate to another language nor modify calling arguments, as those actions would invalidate the authority. There are over 150 functions. I can make incidental changes, such as change the file names from .C to .CPP s...

Launching a C# dialog from an unmanaged C++ mfc active x dll

I've been told to write a dialog in C# which must be instantiated from an unmanaged c++ dll. We do this in other places in our code by simply adding a managed c++ class to the C++ project, then calling the C# dll from the managed c++ class. However I'm finding that doesn't work for me from where I have to do it. I think because the c+...

C# program (process) will not unload

I have a C# program that uses a class from another assembly, and this class calls an unmanaged DLL to do some processing. Here is a snippet: public class Util { const string dllName = "unmanaged.dll"; [DllImport(dllName, EntryPoint = "ExFunc")] unsafe static extern bool ExFunc(StringBuilder path, uint field); public bo...

How much of .NET is unmanaged?

Frequently when I am using the Reflector, I come across lots of unsafe code. Anyone knows how much of .NET is unmanaged/safe? ...

How to get the running version of Power Point using C++ unmanaged?

Hi Guys, I am using C++ unmanaged with Power Point (2003 and 2007). How do I get the running version of Power Point (2003 or 2007) with IDispatch? Thanks, any help would be awesome. ...

Why was Google's Chrome browser written almost entirely in C++ and not C# or Java?

Why was Google's Chrome browser written almost entirely in C++ and not C# or Java? ...

C# to C++/CLI to C DLL System.IO.FileNotFoundException

I'm getting System.IO.FileNotFoundException: The specified module could not be found when running C# code that calls a C++/CLI assembly which in turn calls a pure C DLL. It happens as soon as an object is instantiated that calls the pure C DLL functions. BackingStore is pure C. CPPDemoViewModel is C++/CLI calling BackingStore it has a r...

Memory allocation profilers for managed and unmanaged code?

My application runs a combination of C++ (COM objects) and C# managed code. Sadly there is a n elusive memory leak I need to trace down. I've tried AQTime, which looked good on paper, but my app keeps crashing when running underneath it. Any suggestion for a better alternative? Thanks, Boaz ...

Copy one Bitmap onto a larger Bitmap using without using Graphics.DrawImage

This is a follow up from http://stackoverflow.com/questions/648975/rendering-to-a-single-bitmap-object-from-multiple-threads What im trying to achieve is to take a bitmap of say 50x50 pixels and draw it onto a larger bitmap(100x100 pixels) at any point on the larger image, using the bitmaps LockBits function or any other but NOT graphic...

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 there: http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.dllimportattribute.dllimportattribute.aspx So I added the unmanaged dll fil...

How do I use an unmanaged class from a managed DLL in .net?

I have an unmanaged class that I'm trying to dllexport from a managed DLL. I'm trying to use the unmanaged class in another managed DLL. However, when I try to do this I get link errors. I've done this lots of times with unmanaged DLLs so I know how that works. I know how to use "public ref" etc in managed classes. Is there some flag s...

What are the implications of using unsafe code

Aside from the fact that the code itself can access memory directly. What are the other implications of using the "/unsafe" compiler flag and the "fixed" keyword? Are there any knock on effects related to code signing and deployment of my .exe (my app is desktop only)? (This isn't about whether or not I should be doing this, the why is ...

How do I call unmanaged C/C++ code from a C# ASP.NET webpage

I have an ASP.NET website that uses C# and I'd like to call functions from an unmanaged C/C++ DLL. How do I do it? ...

Pinning a delegate within a struct before passing to unmanaged code

I'm trying to use an unmanaged C dll for loading image data into a C# application. The library has a fairly simple interface where you pass in a struct that contains three callbacks, one to receive the size of the image, one that receives each row of the pixels and finally one called when the load is completed. Like this (C# managed defi...

How to convert an IntPtr back into an object

All, this is a follow up from a previous question here: http://stackoverflow.com/questions/727942/c-formatting-external-dll-function-parameters Here specifically is the code that I am trying to convert to C#: FILES_GetMemoryMapping((LPSTR)(LPCTSTR)MapFile, &Size, (LPSTR)MapName, &PacketSize, pMapping, &PagePerSector); // Allocate the m...

How to marshal C++/CLI array of struct to unmanaged C++

I'm searching for the correct syntax to pass a struct array to an unmanaged C++ dll. my dll imports are called like this #define _DllImport [DllImport("Controller.dll", CallingConvention = CallingConvention::Cdecl)] static _DllImport bool _Validation(/* array of struct somehow */); In my client code I have List<MyStruct^> list;...

vshost32.exe crash when calling unmanaged DLL

Hi all, I'm using a VS 2005 app to interface against an unmanaged (Fortran) DLL. When I run the compiled executable straight from the command line, everything is fine - the DLL can be accessed, and I can work with the functions in the DLL. Unfortunately, when I launch the app from VS 2005, I get a popup stating "vshost32.exe has stoppe...

Conversion between managed and unmanaged types in C++?

When I use a GUI in C++ the text fields are stored as managed strings, i think. I need a way to convert them to standard ints, floats and strings. Any help? ...