PC Review


Reply
Thread Tools Rate Thread

How to pass PVOID* to native code from managed code

 
 
BR
Guest
Posts: n/a
 
      13th Jun 2007
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

 
Reply With Quote
 
 
 
 
Mattias Sjögren
Guest
Posts: n/a
 
      13th Jun 2007
>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.
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Loading native code dll using vc++ .net 2.0 managed code antarikshv Microsoft Dot NET Framework 5 25th Apr 2009 11:13 AM
How to pass PVOID* to native code from managed code BR Microsoft Dot NET Framework 1 13th Jun 2007 08:54 PM
mixing managed code with native code rhossi Microsoft VC .NET 1 16th Jan 2007 08:14 PM
Reference and tutorials using/calling native code (dll) from managed code app Mario Microsoft Dot NET Compact Framework 2 2nd Aug 2006 06:06 PM
managed wrapper to native code.. code from 2003 does not work in 2005? Fred Heida Microsoft Dot NET 0 8th Mar 2006 05:09 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:17 PM.