pinvoke Questions

1

Solved

Is there a difference between using [In, Out] and just using ref when passing parameters from C# to C++? I've found a couple different SO posts, and some stuff from MSDN as well that comes close t...
Henson asked 19/11, 2015 at 22:9

3

Should StringBuilder.Capacity be set to the maximum number of .NET characters, without regards to null termination, or must it be set one higher to reserve space for a null terminator when using P/...
Sputter asked 30/10, 2010 at 2:33

1

I'd really like to listen for when a monitor gets hotplugged like when a laptop docs or has a external monitor plugged in. I'm hoping I can do this in .net maybe with some pinvoke.
Kordula asked 16/7, 2010 at 18:14

2

Solved

We are using PInvoke to interop between C# and C++. I have an interop struct as follows, with an identical layout C++ struct on the other side. [StructLayout(LayoutKind.Sequential)] public stru...
Tannie asked 2/11, 2015 at 16:6

2

Solved

How can I get the Window Title that the user currently have focus on? I'm making a program that runs with another Window, and if the user does not have focus on that window I find no reason for my ...
Melton asked 6/10, 2015 at 8:36

5

After switching to VS2010, the managed debug assistant is displaying an error about an unbalanced stack from a call to an unmanaged C++ function from a C# application. The usuals suspects don't see...
Eutectoid asked 5/3, 2010 at 22:33

5

Solved

BACKGROUND I need to write a tool using .NET version 2.0 at highest (using something off the shelf is not an option for this client for political, commercial, and confidentiality/trust reasons) to...
Leshalesher asked 27/7, 2009 at 21:8

1

Solved

I've been trying to disable the DPI awareness on a ClickOnce application. I quickly found out, it is not possible to specify it in the manifest, because ClickOnce does not support asm.v3 in the man...
Prescind asked 21/8, 2015 at 19:41

1

Solved

Scenario This should be an easy task, but for some reason I can't get it going as intended. I have to marshal a basic C++ struct during a reversed-P/Invoke call (unmanaged calling managed code). ...
Lazaro asked 20/8, 2015 at 5:27

2

Solved

Is there any way to pass C# object references (class types, not structs) into and out of C++ via native interop? Here's my use case: I'm trying to write a game engine in C# but want to use a nati...
Chantilly asked 19/8, 2015 at 20:29

2

Specifically, if I make a struct that has a single field, that essentially acts as a wrapper around that value, is it safe to pass this struct to a P/Invoke method expecting the underlying type? I...
Pelagia asked 27/7, 2015 at 10:56

1

Solved

I have a sample Java app that I got when I downloaded javaaccessablity-2.0.2 that makes use of Java Accessibility (via the Java Access Bridge WindowsAccessBridge-32.dll). Although it calls the getA...
Maddeu asked 2/7, 2015 at 13:53

1

Solved

In C# or else VB.Net, knowing the ubication of a visual theme .theme file, I would like to apply that visual theme in Windows, without depending on other applications such as RunDll32.exe, just P/I...
Homer asked 23/6, 2015 at 9:31

1

Solved

I'm invoking an unmanaged function in my C# code. The declaration of this function is as follow: int myFun(unsigned char* inputBuffer, unsigned char* &outputBuffer); I use this function as...
Grillparzer asked 6/6, 2015 at 7:29

2

Solved

So today I was browsing around ILSpy to get a better understanding of how .NET performs DllImports on external methods, when I came across something odd: When searching for references to the enum ...
Spermic asked 3/6, 2015 at 12:53

1

Solved

I am calling two C++ functions from C#. While doing that in a iteration for around 1 million call i am seeing a overhead of about 30%. C++ function : EXTERN_C void STDAPICALLTYPE FunctionA(UINT_...
Stewart asked 18/5, 2015 at 14:33

1

Solved

I am calling a DLL function written in Delphi XE2 from C# using P/Invoke. It appears to be working when calls are made sequentially from a single thread. However, when multiple threads are calling ...
Hydrocephalus asked 12/5, 2015 at 11:29

4

Solved

I am using PInvoke for interoperability between Native Code (C++) and Managed Code (C#). I just write a simple function which gets a string from C++ code. My code looks like C# Code: [DllI...
Mayor asked 14/3, 2011 at 12:1

2

Solved

I try to call a plain C-function from an external DLL out of my C#-application. This functions is defined as void set_param(const char *data) Now I have some problems using this function: How ...
Isomer asked 4/5, 2015 at 11:8

2

Solved

I have the following types in C++: typedef void* keychain_handle; typedef struct { const char* keyHolderName; unsigned int numKeys; key* keys; } key_holder; typedef struct { const char* keyN...
Introrse asked 18/3, 2015 at 15:59

2

Solved

Consider the following scenario: I'm running my application which, during its execution, has to run another process and only after that 2nd process finishes inner specific initialization, can my fi...
Icao asked 8/11, 2010 at 12:44

0

I have the following code: foreach (var process in Process.GetProcessesByName(name)) { try { process.Kill(); if (!process.WaitForExit(timeout)) { session.Log("Killing process {0} timed out."...
Brendabrendan asked 16/3, 2015 at 18:38

1

Solved

Imagine I have a function called Myfunction(const void * x); My C# declaration could be MyFunction(IntPtr x); Is this functionally and technically equivalent to struct MyStruct { IntPtr P; }...
Irmgardirmina asked 12/2, 2015 at 0:55

1

Solved

I'm trying to use a native API method (GetNativeSystemInfo) that is marked as supported for both phone and desktop Store apps on Windows 8.1. In the documentation, it is listed as living in kernel3...

3

Solved

I've been spending a few days (or more) trying to get this to work. The application at hand is FTPRush, and I know there is a cmd line application called rush_cmdline.exe which uses SendMessage to...
Nigh asked 21/7, 2011 at 16:47

© 2022 - 2024 — McMap. All rights reserved.