Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » Upload PNG file to CExtToolControlbar Collapse All
Subject Author Date
Debabrata Mukherjee Sep 17, 2007 - 7:01 AM

Hi,

I need to load a png file in a CExtToolControlBar.
I have included ProfSkin.h as a header and used CExtSkinBitmap to upload that png file.
I have taken help from the code snippet given below.

LPCTSTR strPngImageResourceID = MAKEINTRESOURCE( IDR_PNG_RESOURCE_IMAGE );
LPCTSTR strPngResourceSection = _T("PNG");
HINSTANCE hInst = AfxFindResourceHandle( strPngImageResourceID, strPngResourceSection );
ASSERT( hInst );
HRSRC hRsrc = FindResourceHandle( hInst, strPngImageResourceID, strPngResourceSection );
ASSERT( hRsrc );
VERIFY( _bmpTmp.LoadPNG_Resource( hInst, hRsrc ) );

Here, I got an error in the FindResourceHandle method. The Message is "’FindResourceHandle’: identifier not found".

Can you help me to upload the png file into the CExtToolControlBar?

Suhai Gyorgy Sep 17, 2007 - 7:23 AM

Sorry, I gave you a wrong answer in the previous post. You should use
HRSRC hRsrc = ::FindResource( hInst, strPngImageResourceID, strPngResourceSection );

Suhai Gyorgy Sep 17, 2007 - 7:17 AM

Try calling g_ResourceManager->FindResourceHandle(...).