How to pass PVOID* to native code from managed code - DOTNET
This is a discussion on How to pass PVOID* to native code from managed code - DOTNET ; Hi,
I need to call a native windows method which has the following
signature
BOOL SomeMethod(PVOID* value);
value [out] - The original value.
I am calling this method using DllImport and am passing in an IntPtr.
Intptr val = IntPtr.Zero;
...
-
How to pass PVOID* to native code from managed code
Hi,
I need to call a native windows method which has the following
signature
BOOL SomeMethod(PVOID* value);
value [out] - The original value.
I am calling this method using DllImport and am passing in an IntPtr.
Intptr val = IntPtr.Zero;
bool status = SomeMethod(val);
but this results in the method returning failure and GetLastError
gives me error code 1. (ERROR_INVALID_FUNCTION)
I suspect that this is because I am not passing in the correct data
type from the managed code.
What managed datatype should I use for a PVOID* ?
Thanks,
Roshan
-
Re: How to pass PVOID* to native code from managed code
>I suspect that this is because I am not passing in the correct data
>type from the managed code.
>What managed datatype should I use for a PVOID* ?
out IntPtr
Mattias
--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
-
Re: How to pass PVOID* to native code from managed code
>I suspect that this is because I am not passing in the correct data
>type from the managed code.
>What managed datatype should I use for a PVOID* ?
out IntPtr
Mattias
--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Similar Threads
-
By Application Development in forum DOTNET
Replies: 3
Last Post: 03-11-2007, 07:30 AM
-
By Application Development in forum DOTNET
Replies: 1
Last Post: 08-31-2006, 08:04 AM
-
By Application Development in forum DOTNET
Replies: 0
Last Post: 06-08-2006, 05:48 AM
-
By Application Development in forum DOTNET
Replies: 4
Last Post: 03-01-2006, 02:20 PM