![]() |
[solved] Runtime check Failure and Load Failed |
Post Reply ![]() |
Author | |
Cedric_ar ![]() Groupie ![]() Joined: 04 September 2012 Status: Offline Points: 19 |
![]() ![]() ![]() ![]() ![]() Posted: 07 March 2017 at 1:29pm |
hi,
I'm currently using 16.1 and I try to upgrade to 17.3. but I have 2 problem. 1st problem : Run-Time Check Failure #2 - Stack around the variable 'szHashName' was corrupted. here my callstack > ToolkitPro1730v140x64D.dll!CXTPSkinManagerSchemaCodeManager::MapKey(const TMS_SCHEMA_ENTRY * pArray, const char * key, const char * prefix) Line 1138 C++ ToolkitPro1730v140x64D.dll!CXTPSkinManagerSchema::GetClassCode(const char * lpszClass) Line 328 C++ ToolkitPro1730v140x64D.dll!CXTPSkinManagerSchema::GetClass(const ATL::CStringT<char,StrTraitMFC_DLL<char,ATL::ChTraitsCRT<char> > > & strClassList) Line 1990 C++ ToolkitPro1730v140x64D.dll!CXTPSkinManager::GetSkinClass(const CXTPSkinObject * pObject, ATL::CStringT<char,StrTraitMFC_DLL<char,ATL::ChTraitsCRT<char> > > strClassList) Line 751 C++ ToolkitPro1730v140x64D.dll!CXTPSkinManagerApiHook::OnHookOpenThemeData(HWND__ * hWnd, const wchar_t * pszClassList) Line 2371 C++ ToolkitPro1730v140x64D.dll!CXTPWinThemeWrapper::OpenThemeData(HWND__ * hWnd, const wchar_t * pszClassList) Line 553 C++ KS_GUI.dll!KS_MFCEditorApp::InitApp() Line 237 C++ This problem appear when i writing This m_themeWrapper.OpenThemeData( *m_pMainWnd, L"BUTTON;CLOCK;COMBOBOX;" L"COMMUNICATIONS;CONTROLPANEL;DATEPICKER;DRAGDROP;" L"EDIT;EXPLORERBAR;FLYOUT;GLOBALS;HEADER;LISTBOX;LISTVIEW;MENU;MENUBAND;" L"NAVIGATION;PAGE;PROGRESS;REBAR;SCROLLBAR;SEARCHEDITBOX;SPIN;STARTPANEL;" L"STATUS;TAB;TASKBAND;TASKBAR;TASKDIALOG;TEXTSTYLE;TOOLBAR;TOOLTIP;" L"TRACKBAR;TRAYNOTIFY;TREEVIEW;WINDOW" ); 2nd problem : i've a assert on Program: \ToolkitPro1730v140x64D.dll File: ..\..\Source\Common\XTPDrawHelpers.cpp Line: 3900 the callstack > ToolkitPro1730v140x64D.dll!CXTPPrimitiveDrawer::InitFont() Line 3900 C++ ToolkitPro1730v140x64D.dll!CXTPPrimitiveDrawer::DrawSymbol(CDC * pDC, XTPPrimitiveSymbol nSymbol, const CRect & rc, unsigned long crForeColor, unsigned long crBackColor, int bOutline, HPEN__ * hOutlinePen) Line 3951 C++ ToolkitPro1730v140x64D.dll!CXTPPaintManager::DrawDropDownGlyph(CDC * pDC, CXTPControl * __formal, CPoint pt, int bSelected, int bPopuped, int bEnabled, int bVert) Line 890 C++ ToolkitPro1730v140x64D.dll!CXTPPaintManager::DrawControlToolBarParent(CDC * pDC, CXTPControl * pButton, int bDraw) Line 2227 C++ ToolkitPro1730v140x64D.dll!CXTPPaintManager::DrawControl(CDC * pDC, CXTPControl * pButton, int bDraw) Line 1417 C++ ToolkitPro1730v140x64D.dll!CXTPControl::GetSize(CDC * pDC) Line 158 C++ ToolkitPro1730v140x64D.dll!CXTPControls::XTPBUTTONINFO::Attach(CDC * pDC, CXTPControl * p) Line 710 C++ ToolkitPro1730v140x64D.dll!CXTPControls::CalcDynamicSize(CDC * pDC, int nLength, unsigned long dwMode, const CRect & rcBorder, int nWidth) Line 1451 C++ ToolkitPro1730v140x64D.dll!CXTPToolBar::CalcDockingLayout(int nLength, unsigned long dwMode, int nWidth) Line 764 C++ ToolkitPro1730v140x64D.dll!CXTPTabToolBar::CalcDockingLayout(int nLength, unsigned long dwMode, int nWidth) Line 647 C++ ToolkitPro1730v140x64D.dll!CXTPDockBar::_AdjustRow(CArray<CXTPToolBar *,CXTPToolBar *> & arrRow, CPoint pt, int nLength, int bHorz, AFX_SIZEPARENTPARAMS * lpLayout, int & nRemove) Line 194 C++ ToolkitPro1730v140x64D.dll!CXTPDockBar::AdjustRow(CArray<CXTPToolBar *,CXTPToolBar *> & arrRow, CPoint pt, int nLength, int bHorz, AFX_SIZEPARENTPARAMS * lpLayout) Line 355 C++ ToolkitPro1730v140x64D.dll!CXTPDockBar::CalcDynamicLayout(int nLength, unsigned long nMode, AFX_SIZEPARENTPARAMS * lpLayout) Line 415 C++ ToolkitPro1730v140x64D.dll!CXTPDockBar::OnSizeParent(unsigned __int64 __formal, __int64 lParam) Line 483 C++ with 16.1 i haven't those issue. I'm using DLL without unicode. |
|
![]() |
|
olebed ![]() Admin Group ![]() Joined: 01 July 2014 Location: Ukraine Status: Offline Points: 841 |
![]() ![]() ![]() ![]() ![]() |
Hello,
First problem needs more time to investigation. About second problem I can advice to review settings of project. Regards, Oleksandr Lebed |
|
![]() |
|
Cedric_ar ![]() Groupie ![]() Joined: 04 September 2012 Status: Offline Points: 19 |
![]() ![]() ![]() ![]() ![]() |
thanks for the reply I forget to mention. I'm on Window 10 ( anniversary update ) with Visual Studio 2015 update 3 For the font problem i read this post. it's refer to a static utilisation of XTP. i'm using DLL version. My project setting ( dll project ) are correct : 'Configuration Properties' > General > 'Use of MFC' > 'Use MFC in a Shared DLL' 'Configuration Properties' > 'C/C++' > 'Code generation' > 'Runtime Library' > 'Multi-threaded DLL (/MD)' regards |
|
![]() |
|
olebed ![]() Admin Group ![]() Joined: 01 July 2014 Location: Ukraine Status: Offline Points: 841 |
![]() ![]() ![]() ![]() ![]() |
in that post described settings of ToolkitPro library. Please check its settings and rebuild it. |
|
![]() |
|
olebed ![]() Admin Group ![]() Joined: 01 July 2014 Location: Ukraine Status: Offline Points: 841 |
![]() ![]() ![]() ![]() ![]() |
Documentation for CXTPWinThemeWrapper::OpenThemeData(): Open the theme data for the specified HWND and semi-colon separated list of class names. OpenThemeData() will try each class name, one at a time, and use the first matching theme info found. void OpenThemeData( HWND hWnd, LPCWSTR pszClassList );
hWnd Window handle of the control/window to be
themed. pszClassList Class name (or list of names) to match to theme data
section. if the list contains more than one name, the names are tested one at a
time for a match. If a match is found, OpenThemeData() returns a theme handle
associated with the matching class. This param is a list (instead of just a
single class name) to provide the class an opportunity to get the "best" match
between the class and the current theme. For example, a button might pass
L"OkButton;Button" if its ID=ID_OK. If the current theme has an entry for
OkButton, that will be used. Otherwise, we fall back on the normal Button entry. See examples on this forum (link, link) I have explored callstack for CXTPSkinManagerSchemaCodeManager::MapKey and can see that SkinFramework doesn't support splitting of ClassList. To compare strings there is used _tcsicmp() which compare whole strings. That is why method MapKey even doesn't have checking of length of string on copying. It expects that class name will be one from global array with class names and parts (gSchemaClassAndPartsCodes). Also if you want to use single CXTPWinThemeWrapper for all controls you should to know, that CXTPSkinManagerSchemaCodeManager::MapKey method caches key ( |
|
![]() |
|
olebed ![]() Admin Group ![]() Joined: 01 July 2014 Location: Ukraine Status: Offline Points: 841 |
![]() ![]() ![]() ![]() ![]() |
I have fixed noticed defects. Changes will be available in next beta or final release.
Regards, Oleksandr Lebed |
|
![]() |
|
SvenC ![]() Groupie ![]() Joined: 02 February 2007 Status: Offline Points: 79 |
![]() ![]() ![]() ![]() ![]() |
As you hinted several times about that: can you already announce an expected time frame for 18.0 beta and/or release? Really looking forward to that
![]() |
|
--
SvenC Toolkit Pro 15.3.1, 16.2.4, 16.3.1, 16.4.0, 17.2.0, 17.3.0, 18.0.1, 18.2 with VC++ 2010, 2012, 2013, 2015, 2017 |
|
![]() |
|
olebed ![]() Admin Group ![]() Joined: 01 July 2014 Location: Ukraine Status: Offline Points: 841 |
![]() ![]() ![]() ![]() ![]() |
![]() |
|
Cedric_ar ![]() Groupie ![]() Joined: 04 September 2012 Status: Offline Points: 19 |
![]() ![]() ![]() ![]() ![]() |
For runtime check failure. i'll change my code according to your reply. For the Font loading On codejock.Toolkitpro.shared project this options ar correctly setup 'Configuration Properties' > General > 'Use of MFC' > 'Use MFC in a Shared DLL' 'Configuration Properties' > 'C/C++' > 'Code generation' > 'Runtime Library' > 'Multi-threaded DLL (/MD)' but i think it's my project setup that cause the problem. I've a small exe with plenty of dll. I have a dll use for the GUI, these dll is linked to XTP in dll too. When i debug void CXTPPrimitiveDrawer::InitFont() this line HMODULE hResModule = AfxFindResourceHandle( MAKEINTRESOURCE(XTP_IDC_FONT_CODEJOCK), RT_FONT); always return my GUI dll not XTP dll ( i've checkef in my dll if a have a same resource type with the same id but no ). then if step in AfxFindResourceHandle, only my gui dll and mfc40s.dll are parsed. then i try to add this at the begin of function and it's works now void CXTPPrimitiveDrawer::InitFont() { if (NULL == m_hCodejockMemFont) { // custom modification #ifdef _AFXDLL #ifdef _DEBUG HMODULE hResDll = LoadLibrary( _T( "ToolkitPro1730v140x64D.dll") ); else HMODULE hResDll = LoadLibrary( _T( "ToolkitPro1730v140x64.dll" ) ); #endif AfxSetResourceHandle( hResDll ); #endif // I think it's not the best solution, but it's works for me. |
|
![]() |
|
olebed ![]() Admin Group ![]() Joined: 01 July 2014 Location: Ukraine Status: Offline Points: 841 |
![]() ![]() ![]() ![]() ![]() |
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |