Print Page | Close Window

[solved] Problem with docking pane icons v18.0.1

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=23215
Printed Date: 23 December 2024 at 11:06am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: [solved] Problem with docking pane icons v18.0.1
Posted By: lviolette
Subject: [solved] Problem with docking pane icons v18.0.1
Date Posted: 29 November 2016 at 4:56pm
We have an SDI App that hosts in a DLL the mainframe and UI.  When we updated to CodeJock 17.2 from 15, the code that controls the drawing of docking pane icons, like the Pin and Close buttons changed to be resource based.

You can see the new code in XTPDrawhelpers::InitFont which gets called by XTPPrimitiveDrawer::DrawSymbol.

What happens is that InitFont gets called and my DLL is the current thread module (not the application EXE).  So, when InitFont calls AfxFindResourceHandle, it does not succeed in loading the ToolkitPro DLL and is not able to find XTP_IDC_FONT_CODEJOCK.  Thus, an ASSERT.

I have created a sample application/dll that demonstrates this problem.

Basically the docking pane icons look like this:

Instead of this:

To show that the icon should be here, here's what it looks like when I hover over where the icon should be:

I have created a sample visual studio project that re-creates the problem. You can extract it with WinRAR.

If you extract it so that the root folder is under the CodeJock\Samples folder, it "should" build the DLL and EXE to the correct CodeJock\bin folder.
uploads/2857/TestSDI_DLL.rar" rel="nofollow - uploads/2857/TestSDI_DLL.rar

Would appreciate if you have any advice.


-------------
L. Violette
Monolith
www.lith.com
Xtreme Toolkit Pro v22.1.0



Replies:
Posted By: lviolette
Date Posted: 01 December 2016 at 7:51pm
I have confirmed that this continues to be a problem in version 17.3.

It appears that you can't use dynamic linking of toolkit AND host UI in a DLL instead of an EXE....




-------------
L. Violette
Monolith
www.lith.com
Xtreme Toolkit Pro v22.1.0


Posted By: Recomatics
Date Posted: 09 March 2017 at 3:34am
Same problem here , 
changed the code of the ..\Source\Common\XTPDrawHelpers.cpp
to :
...
void CXTPPrimitiveDrawer::InitFont()
{
AFX_MANAGE_STATE(AfxGetAppModuleState());
if (NULL == m_hCodejockMemFont)
{
::EnterCriticalSection(&m_fontAccess);
if (NULL == m_hCodejockMemFont
... 




Posted By: lviolette
Date Posted: 18 September 2017 at 7:54pm
I can confirm that adding AFX_MANAGE_STATE has fixed the issue for us.

-------------
L. Violette
Monolith
www.lith.com
Xtreme Toolkit Pro v22.1.0


Posted By: olebed
Date Posted: 01 October 2017 at 9:16am
Hello Recomatics,

Your solution was introduced in CXTPPrimitiveDrawer::InitFont().

Thank you.

Regards,
 Oleksandr Lebed



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