Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - SetImageHandle Error
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

SetImageHandle Error

 Post Reply Post Reply
Author
Message
hari View Drop Down
Newbie
Newbie


Joined: 12 July 2007
Location: Iceland
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote hari Quote  Post ReplyReply Direct Link To This Post Topic: SetImageHandle Error
    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.
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 10 September 2008 at 9:25am
Hi,
 
Try to specify "OFFICE2007BLUE.INI" as second parameter.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
hari View Drop Down
Newbie
Newbie


Joined: 12 July 2007
Location: Iceland
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote hari Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
hari View Drop Down
Newbie
Newbie


Joined: 12 July 2007
Location: Iceland
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote hari Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.250 seconds.