Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Skin Framework
  New Posts New Posts RSS Feed - crash with CFileDialog
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

crash with CFileDialog

 Post Reply Post Reply
Author
Message
thwei View Drop Down
Newbie
Newbie
Avatar

Joined: 16 November 2007
Location: Poland
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote thwei Quote  Post ReplyReply Direct Link To This Post Topic: crash with CFileDialog
    Posted: 05 January 2008 at 1:06pm
Unhandled exception at 0x76c841f4 in CallCenterViewer.exe: 0xC0000005: Access violation reading location 0xcdcdcde0.

Stack trace:
     imagehlp.dll!76c841f4()    
     [Frames below may be incorrect and/or missing, no symbols loaded for imagehlp.dll]   
     imagehlp.dll!76c841c9()    
>    ToolkitPro1122vc80D.dll!CXTPSkinManagerApiFunction::ReplaceInOneModule(const char * pszCalleeModName=0x033598ac, int (void)* pfnCurrent=0x7c801d77, int (void)* pfnNew=0x01f3f50d, HINSTANCE__ * hmodCaller=0xcdcdcdcd)  Line 383 + 0x14 bytes    C++
     ToolkitPro1122vc80D.dll!CXTPSkinManagerApiHook::HackModuleOnLoad(HINSTANCE__ * hmod=0x6ed50000, unsigned long dwFlags=0)  Line 1227 + 0x27 bytes    C++
     ToolkitPro1122vc80D.dll!CXTPSkinManagerApiHook::OnHookLoadLibraryExW(const wchar_t * pszModuleName=0x00134bb8, void * hFile=0x00000000, unsigned long dwFlags=0)  Line 1297    C++
     libapr_tsvn.dll!6eec6ff4()    
     libapriconv_tsvn.dll!6ee52478()    
     ntdll.dll!7c96d886()    


Crash always when i call code:
CFileDialog *dlg = new  CFileDialog( TRUE, "", "", OFN_EXPLORER|OFN_OVERWRITEPROMPT|OFN_PATHMUSTEXIST);
    if(dlg->DoModal() == IDOK) {

or other CFileDialog DoModal function.
if  I first run other modal window in application CFileDialog works ok for
all next time.
i use office2007 skin


When I compile and run sample SkinMDISample the same effect crash when  I click toolbar "open".
WindowsXP Microsoft Visual Studio 8 sp1

Whe tested SkinMDISample  on 3 odd komputers, and then crashed on all.


Back to Top
Alex View Drop Down
Groupie
Groupie
Avatar

Joined: 12 May 2004
Status: Offline
Points: 54
Post Options Post Options   Thanks (0) Thanks(0)   Quote Alex Quote  Post ReplyReply Direct Link To This Post Posted: 10 January 2008 at 8:36am
Hi there,
 
I have the same problem.
 
My app uses a Ribbonbar plus I have loaded the vista skin via LoadSkin.
 
XTremeToolkit version is v11.2.2.
 
Without loading the skin it works without a problem.
 
Regards,
Alex
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 January 2008 at 1:02pm

Hello,

 
Can you please replace HackModuleOnLoad as it was in 11.2.1 release:
 
void CXTPSkinManagerApiHook::HackModuleOnLoad(HMODULE hmod, DWORD dwFlags)
{
 for (int i = 0; i < (int)m_arrExcludedModules.GetSize(); i++)
 {
  EXCLUDEDMODULE& em = m_arrExcludedModules;
  if (em.hModule == NULL) em.hModule = GetModuleHandle(em.strModule);
 }
 if (IsModuleExcluded(hmod, TRUE))
  return;
 if ((hmod != NULL) && ((dwFlags & LOAD_LIBRARY_AS_DATAFILE) == 0))
 {
  for (int i = 0; i < XTP_SKIN_APIHOOKCOUNT; i++)
  {
   CXTPSkinManagerApiFunction* pHook = m_arrFunctions;
   if (pHook)
   {
    if (pHook->ReplaceInOneModule(pHook->m_szCalleeModName, pHook->m_pfnOrig, pHook->m_pfnHook, hmod))
    {
     pHook->m_bHooked = TRUE;
    }
   }
  }
 }
}
 
We will find reason why new version of this method failed.
 
Thanks
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Alex View Drop Down
Groupie
Groupie
Avatar

Joined: 12 May 2004
Status: Offline
Points: 54
Post Options Post Options   Thanks (0) Thanks(0)   Quote Alex Quote  Post ReplyReply Direct Link To This Post Posted: 10 January 2008 at 5:21pm
Thank you for the quick response.
 
After little modifications on the source, I was able to compile it.
 
BTW, it works as expected.
 
Regards,
Alex
Back to Top
thwei View Drop Down
Newbie
Newbie
Avatar

Joined: 16 November 2007
Location: Poland
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote thwei Quote  Post ReplyReply Direct Link To This Post Posted: 11 January 2008 at 5:33am
void CXTPSkinManagerApiHook::HackModuleOnLoad(HMODULE hmod, DWORD dwFlags)
{
    for (int i = 0; i < (int)m_arrExcludedModules.GetSize(); i++)
    {
        EXCLUDEDMODULE& em = m_arrExcludedModules;
        if (em.hModule == NULL) em.hModule = GetModuleHandle(em.strModule);
    }
    if (IsModuleExcluded(hmod))
        return;
    if ((hmod != NULL) && ((dwFlags & LOAD_LIBRARY_AS_DATAFILE) == 0))
    {
        for (int i = 0; i < XTP_SKIN_APIHOOKCOUNT; i++)
        {
            CXTPSkinManagerApiFunction* pHook = m_arrFunctions;
            if (pHook)
            {
                if (pHook->ReplaceInOneModule(pHook->m_szCalleeModName, pHook->m_pfnOrig, pHook->m_pfnHook, hmod))
                {
                    pHook->m_bHooked = TRUE;
                }
            }
        }
    }
}

[]

This code work fine.
Thanks

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: 12 January 2008 at 2:55am
Hi,
We will revert it for 12.0 release.
Thanks.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
pijnappel View Drop Down
Groupie
Groupie


Joined: 30 November 2007
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote pijnappel Quote  Post ReplyReply Direct Link To This Post Posted: 31 July 2009 at 4:16am
Was this fixed with 12.0?
I still have problems with CFileDialog with V12.

When calling DoModal the application hangs. Everything works fine on XP.

Edit: Sorry I forgot, we're still using Visual Studio 6 (VC6)
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.109 seconds.