Print Page | Close Window

SetImageHandle Error

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=12124
Printed Date: 21 December 2024 at 8:59pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: SetImageHandle Error
Posted By: hari
Subject: SetImageHandle Error
Date Posted: 10 September 2008 at 4:48am
hi

In vista (VS2008), the below code is crashing the exe.


VERIFY(InitCommandBars());
CXTPCommandBars* pCommandBars = GetCommandBars();
HMODULE hModule =LoadLibrary(theApp.m_AppPath +_T("\\Office2007Blue.dll"));
   
    CXTPPaintManager::SetTheme(  hModule ? xtpThemeRibbon : xtpThemeOffice2003 );

    if(hModule)
    {
       
               ((CXTPOffice2007Theme*)pCommandBars->GetPaintManager())->SetImageHandle( Module, 0/*_T("Office2007Theme.ini")*/ );
        //((CXTPOffice2007Theme*)pCommandBars->GetPaintManager())->SetImageHandle( *hModule*/ m_hModuleOfficeBlueRes, 0/*_T("Office2007Theme.ini")*/ );
    }
 

It is crashing on the SetImageHandle func.


Using Toolkit pro static link.

Please help.



Replies:
Posted By: Oleg
Date Posted: 10 September 2008 at 9:25am
Hi,
 
Try to specify "OFFICE2007BLUE.INI" as second parameter.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: hari
Date Posted: 11 September 2008 at 11:57pm
Hi

I can set ribbon theme in _DEBUG mode ; but not in release mode.
It is crashing on SetImageHandle.

Also found that I cannot set office2007 theme in mfc static link, but it works ok in mfc shared dll mode.

CJ Sample DialogSample in commandbars also has the same issue so I think this is related to MFC library. When building with STATIC_LINK and static link to MFC, no commandbars are created.

I  dont have VS2008 SP1 installed.


Posted By: hari
Date Posted: 12 September 2008 at 11:32pm
I reinstalled VS2008 and recompiled CJ  and now I can set Office2007 theme. Must have been a corrupted VS2008 SP1 install which did not complete.


Ribbon is still not possible using _XTP_STATICLINK and MFC static. Please help.

The issue with CJ DialogSample still exists. When building with _XTP_STATICLINK and static link to MFC, no commandbars are created.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net