Print Page | Close Window

Asserts in 24.0 beta

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=24479
Printed Date: 23 September 2024 at 9:37pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Asserts in 24.0 beta
Posted By: rconn
Subject: Asserts in 24.0 beta
Date Posted: 19 May 2024 at 5:30pm
All of my apps are now asserting when compiled under the 24.0 beta:

int CXTPApplication::GetComInitFlags() const
{
_ASSERTE(NULL != m_pComInit);
return m_pComInit->GetInitFlags();
}

They work with 22.1.  I'm calling AfxOleInit before the XTP code is called; is there something else that needs to be done w/24.0?



Replies:
Posted By: astoyan
Date Posted: 20 May 2024 at 11:02am
In order to allow ToolkitPro to use COM/OLE during its initialization and to provide a way to have a consistent COM/OLE initialization methods for all application threads, the new ToolkitPro v24 initializes it itself from CXTPWinApp constructor. The new CXTPWinApp::CXTPWinApp constructor now takes an optional argument of XTPComInit enumeriation type. If no argument is provided that the default xtpComInitAfxOle is used. For more other COM/OLE initalization methods refer to XTPComInit documentation.

For example:

class CMyApp : CXTPWinApp {
  CMyApp() : CXTPWinApp(xtpComInitAfxOle) { ... }
  ...
}

class CMyThread : CWinThread {
 virtual BOOL Run() {
   CXTPComInitializer comInit(xtpComInitAfxOle);
   ...
 }
}

Regards,
  Alexander


Posted By: essess
Date Posted: 23 May 2024 at 9:12am
In version 19.3.0 we call CXTPPaintManager::SetTheme(...) inside dynamically loaded DLLs to set the same Toolkit Pro theme as the main thread.

Now in v24.0.0.042924 (beta 1) we get the same assert and crash as rconn in GetComInitFlags:

XTPApplication.cpp:
int CXTPApplication::GetComInitFlags() const
{
_ASSERTE(NULL != m_pComInit); <<<<
return m_pComInit->GetInitFlags();
}

Continuing from the assert causes a crash at the location:

XTPSystemHelpers.h:
AFX_INLINE int CXTPComInitializer::GetInitFlags() const
{
return m_xtpComInit; << this was nullptr
}

Why am I getting this issue in v24?

Removing the call to "SetTheme()" seems to help, but I haven't been able to verify if the theme is then set correctly.


Posted By: rconn
Date Posted: 24 May 2024 at 10:44am
Does your app derive from CWinApp or CXTPWinApp?  My older ones were using CWinApp (which is what the CJ samples used years ago); when I changed to CXTPWinApp the assert went away.




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