Need VB version of VC++ MAKEINTRESOURCE macro 
Author Message
 Need VB version of VC++ MAKEINTRESOURCE macro

Hi,

            I want my application to load an icon in its best color depth
available. Since VB5 doesn't do it, I researched and found C++ examples I
saw requires the MAKEINTRESOURCE macro. I don't know C++, thus I couldn't
port the code from the Platform SDK to VB. I don't even know if it's
possible, I suppose it is. Anyway, can anybody help me?

Tales Normando



Sat, 28 Jun 2003 19:20:23 GMT  
 Need VB version of VC++ MAKEINTRESOURCE macro
The macro is:

#define MAKEINTRESOURCEA(i) (LPSTR)((ULONG_PTR)((WORD)(i)))
#define MAKEINTRESOURCEW(i) (LPWSTR)((ULONG_PTR)((WORD)(i)))

All it is doing is casting a variable several different ways. You can use
the conversion functions such as CInt(), CLng() and CStr() to mimic the
behavior.

But I doubt that would REALLY help you as much as explaining what you are
trying to do with the sample, perhaps posting your conversion attempt and
explaining what is failing, precisely.

--
MichKa

a new book on internationalization in VB at
http://www.i18nWithVB.com/


Quote:
> Hi,

>             I want my application to load an icon in its best color depth
> available. Since VB5 doesn't do it, I researched and found C++ examples I
> saw requires the MAKEINTRESOURCE macro. I don't know C++, thus I couldn't
> port the code from the Platform SDK to VB. I don't even know if it's
> possible, I suppose it is. Anyway, can anybody help me?

> Tales Normando



Sat, 28 Jun 2003 20:44:29 GMT  
 Need VB version of VC++ MAKEINTRESOURCE macro
Tales,

Quote:
>            I want my application to load an icon in its best color depth
>available. Since VB5 doesn't do it, I researched and found C++ examples I
>saw requires the MAKEINTRESOURCE macro. I don't know C++, thus I couldn't
>port the code from the Platform SDK to VB. I don't even know if it's
>possible, I suppose it is. Anyway, can anybody help me?

You don't need this macro in VB. Just declare the name parameter of
the API you are using (LoadImage or LoadIcon) As Any. You can then
either pass it a Long with a numeric ID, or a String ID.

Matt

============================================

CodeHound - The Software Developer's Search Engine
http://www.codehound.com



Sat, 28 Jun 2003 21:00:36 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. I need vc ide macro help, trying to create a move to end of word macro

2. I need help from a vb and vc++ expert

3. Need help passing a DC handle from vb to a vc++ dll

4. I need help from a vb and vc++ expert

5. VB equivalent of MAKEINTRESOURCE?

6. VB 4.0 32 Bit Version.dll example needed - use functions in version dll.htm (1/1)

7. VB 4.0 32 Bit Version.dll example needed - use functions in version dll.htm (0/1)

8. VB-version of VC++-program DragImage?

9. Need help passing a DC to a vc++ dll

10. Need help passing a DC to a vc++ dll

11. 3rd party tools for VB vs VC vs VC++

12. VB vs. VC++, Need ur opinion plz

 

 
Powered by phpBB® Forum Software