Print Page | Close Window

the XTPResourceManager()->Close().

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=18489
Printed Date: 01 February 2025 at 7:38am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: the XTPResourceManager()->Close().
Posted By: roninda
Subject: the XTPResourceManager()->Close().
Date 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?



Replies:
Posted By: Oleg
Date 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


Posted By: Insad
Date 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


Posted By: Oleg
Date Posted: 06 June 2011 at 11:25am
 both cases are fine.

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


Posted By: Insad
Date 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


Posted By: jintian01
Date 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;



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