DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Mon, 30 Jul 2007 09:57:49 +0100,    posted on: microsoft.public.dotnet.framework.compactframework        back       

Thread Index
  1    dev15
          2    Peter Foot [MVP]


How to PInvoke the MAKEINTRESOURCE macro   
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 09:57:49 +0100   Author:  

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:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us