Top "Pinvoke" questions

P/Invoke is an implementation specification created by Microsoft of the Common Language Infrastructure (CLI) for invocation of native code libraries from managed code.

pinvokestackimbalance -- how can I fix this or turn it off?

I just switched to vs2010 from vs2008. Exact same solution, except now every single call to a C++ dll yields …

c# c++ visual-studio-2010 visual-studio pinvoke
Passing strings from C# to C++ DLL and back -- minimal example

I am trying to make the absolute simplest minimal example of how to pass strings to and from a C++ …

c# c++ pinvoke
FindWindowEx from user32.dll is returning a handle of Zero and error code of 127 using dllimport

I need to handle another windows application programatically, searching google I found a sample which handles windows calculator using DLLImport …

c# winapi pinvoke dllimport findwindow
Using a 32bit or 64bit dll in C# DllImport

Here is the situation, I'm using a C based dll in my dot.net application. There are 2 dlls, one is 32…

c# .net pinvoke 32bit-64bit dllimport
Best way to access COM objects from C#

I am planning to use various objects that are exposed as COM objects. To make them easier to use, I'd …

c# .net com pinvoke
C#: How to pass null to a function expecting a ref?

I've got the following function: public static extern uint FILES_GetMemoryMapping( [MarshalAs(UnmanagedType.LPStr)] string pPathFile, out ushort Size, [MarshalAs(…

c# null pinvoke parameters ref
PInvokeStackImbalance C# call to unmanaged C++ function

After switching to VS2010, the managed debug assistant is displaying an error about an unbalanced stack from a call to …

c# c++ visual-studio-2010 pinvoke dllimport
Should DWORD map to int or uint?

When translating the Windows API (including data types) into P/Invoke, should I replace DWORD with int or uint? It's …

c# .net winapi pinvoke dword
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 …

c# c++ pinvoke unmanaged managed
Moving mouse cursor programmatically

To start out I found this code at http://swigartconsulting.blogs.com/tech_blender/2005/08/how_to_move_the.html: public …

c# internet-explorer mouse pinvoke cursor