Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Asserts in 24.0 beta
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Asserts in 24.0 beta

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


Joined: 16 May 2007
Location: United States
Status: Offline
Points: 77
Post Options Post Options   Thanks (0) Thanks(0)   Quote rconn Quote  Post ReplyReply Direct Link To This Post Topic: Asserts in 24.0 beta
    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?
Back to Top
astoyan View Drop Down
Admin Group
Admin Group
Avatar

Joined: 24 August 2013
Status: Offline
Points: 299
Post Options Post Options   Thanks (0) Thanks(0)   Quote astoyan Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
essess View Drop Down
Newbie
Newbie


Joined: 25 June 2023
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote essess Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
rconn View Drop Down
Groupie
Groupie


Joined: 16 May 2007
Location: United States
Status: Offline
Points: 77
Post Options Post Options   Thanks (0) Thanks(0)   Quote rconn Quote  Post ReplyReply Direct Link To This Post 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.

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.141 seconds.