Re: How to PInvoke the MAKEINTRESOURCE macro
You can't P/Invoke a macro as by definition it isn't a true function. What
you need to do is find the definition and implement in managed code e.g.
#define MAKEINTRESOURCEW(i) (LPWSTR)((DWORD)((WORD)(i)))
All that is happening is the integer is being cast to a string type.
Therefore you can add a P/Invoke for FindResource which takes an int instead
of a string e.g.
[DllImport("coredll")]
private static extern IntPtr FindResource(IntPtr hModule, int lpName, int
type);
Peter
--
Peter Foot
Microsoft Device Application Development MVP
www.peterfoot.net | www.inthehand.com
In The Hand Ltd - .NET Solutions for Mobility
"dev15" wrote in message
news:%23pBF2eo0HHA.4184@TK2MSFTNGP06.phx.gbl...
> Hi, I need to pass the result of the MAKEINTRESOURCE macro
> to the FindResource function whihc i have PInvoked in my VB.NET CF
> code. How do i do invoke MAKEINTRESOURCE in VB.NET CF code?
>
Date:Mon, 30 Jul 2007 12:26:24 +0100
Author:
|