Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - the XTPResourceManager()->Close().
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

the XTPResourceManager()->Close().

 Post Reply Post Reply
Author
Message
roninda View Drop Down
Groupie
Groupie


Joined: 23 March 2011
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote roninda Quote  Post ReplyReply Direct Link To This Post Topic: the XTPResourceManager()->Close().
    Posted: 03 June 2011 at 8:42am
I run into random access violation when my app exit.
After lots of debug,
i add the
XTPResourceManager()->Close() in the CMainframe::Close()
and everything is ok.


But i don't know why i should do this.....

And so on , i use a lot external resource file .. Is this the reason?
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: 06 June 2011 at 6:45am
yes, recommended call it on exit. maybe better in ExitInstance of your application.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Insad View Drop Down
Groupie
Groupie
Avatar

Joined: 28 October 2004
Location: The Netherlands
Status: Offline
Points: 55
Post Options Post Options   Thanks (0) Thanks(0)   Quote Insad Quote  Post ReplyReply Direct Link To This Post Posted: 06 June 2011 at 10:25am
Hi,
 
Should I call this in my DLLs as well?
 
And should it be called before or after the call to the ExitInstance of the baseclass?
 
Thus like this:
int CD4WinAppBaseEx::ExitInstance()
{
 int iRet = __super::ExitInstance();
 XTPResourceManager()->Close();
 if (IsApplication()) {
  g_strLatestSkinResourcepath.Empty();
  CXTPSkinManager* pSkinMgr = XTPSkinManager();
  if (pSkinMgr != NULL && pSkinMgr->IsEnabled()) {
   TRY {
    pSkinMgr->LoadSkin(NULL, NULL);
   }
   CATCH_ALL(e) {
    ASSERT(FALSE);   // Whatever...
   }
   END_CATCH_ALL;
  }
 }
 else {
  CXTPPaintManager::Done();
  XTPImageManager()->RemoveAll();
 }
 return iRet;
}
 
Or more like this:
int CD4WinAppBaseEx::ExitInstance()
{
 XTPResourceManager()->Close();
 int iRet = __super::ExitInstance();
 if (IsApplication()) {
  g_strLatestSkinResourcepath.Empty();
  CXTPSkinManager* pSkinMgr = XTPSkinManager();
  if (pSkinMgr != NULL && pSkinMgr->IsEnabled()) {
   TRY {
    pSkinMgr->LoadSkin(NULL, NULL);
   }
   CATCH_ALL(e) {
    ASSERT(FALSE);   // Whatever...
   }
   END_CATCH_ALL;
  }
 }
 else {
  CXTPPaintManager::Done();
  XTPImageManager()->RemoveAll();
 }
 return iRet;
}
 
Or maybe I am doing something else wrong?
 
Regards,
 
Insad
Products in use: XTP version 13.4.2/15.3.1/16.4.0/17.3.0
Platforms: Win2003(R2)/Win2008(R2)/Win7/Win2011/Win8(.1)/Win2012(R2)/Win10 (x86/x64)
Langs: VC++ (MFC) 6/2005/2008/2013/2015/2017
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: 06 June 2011 at 11:25am
 both cases are fine.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Insad View Drop Down
Groupie
Groupie
Avatar

Joined: 28 October 2004
Location: The Netherlands
Status: Offline
Points: 55
Post Options Post Options   Thanks (0) Thanks(0)   Quote Insad Quote  Post ReplyReply Direct Link To This Post Posted: 07 June 2011 at 3:46am
Hi Oleg,,
 
Thanks for your prompt reply.
 
But neither of the cases prevents a GPF from happening so possibly there is something else is failing in the code?
 
Can you help me with this or should I make another thread about it?
 
Regards,
 
Insad
 
Products in use: XTP version 13.4.2/15.3.1/16.4.0/17.3.0
Platforms: Win2003(R2)/Win2008(R2)/Win7/Win2011/Win8(.1)/Win2012(R2)/Win10 (x86/x64)
Langs: VC++ (MFC) 6/2005/2008/2013/2015/2017
Back to Top
jintian01 View Drop Down
Newbie
Newbie
Avatar

Joined: 10 December 2011
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote jintian01 Quote  Post ReplyReply Direct Link To This Post Posted: 18 May 2012 at 1:58am
I have the same problem.When the Application exit with Non-Default Languge.
TOOLKITPRO1513VC60UD.DLL): 0xC0000005: Access Violation.will be happen.If I'm not annotation the SetLocale() Function;
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.047 seconds.