Print Page | Close Window

V17 on Win10 doesn't show "..." on PGrid Btns

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=23891
Printed Date: 16 November 2024 at 1:24pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: V17 on Win10 doesn't show "..." on PGrid Btns
Posted By: liong
Subject: V17 on Win10 doesn't show "..." on PGrid Btns
Date Posted: 15 August 2019 at 10:45am
Recently, i honestly don't know for how long, the property grid browse buttons (f.e. ToolbarColor, ColorItem, FontItem, Expand Button) don't show the button text (which are the three dots "...") anymore on Windows 10 with toolkit V17.0.0 and VS2015.
The same binaries still show that on win7 though and some other Windows 10 machines but i couldn't find any difference yet; same HW, Drivers and Windows Updates.
The Property Grid Sample from V15.0.2 with VS2010 on the same Windows 10 machine is working fine.

Does anyone expierience these issues and knows how to fix them?

Edit 1:
Looks like the following is causing the problem:
On machine where it's working, the following modules are loaded:
ToolkitPro1700vc140x64D.dll 17, 0, 0, 0 17.01.2017 13:39
gdi32.dll 10.0.17134.285 (WinBuild.160101.0800) 03.03.2070 16:51

On the machines where it's not working, there are the following:
ToolkitPro1700vc140x64D.dll 17, 0, 0, 0 17.01.2017 13:39
gdi32.dll 10.0.17763.592 (WinBuild.160101.0800) 11.07.2102 23:10

So when the toolkit tries to draw the elision, it delegates that to CXTPPrimitiveDrawer which on creation looks up the function AddFontMemResourceEx from gdi32

HMODULE hGdi32 = GetModuleHandle(_T("gdi32"));
m_pfnAddFontMemResourceEx = reinterpret_cast<PFNAddFontMemResourceEx>(GetProcAddress(hGdi32, "AddFontMemResourceEx"));

and later on in CXTPPrimitiveDrawer::InitFont() calls that function like

m_hCodejockMemFont = m_pfnAddFontMemResourceEx(pFontData, cbFontData, NULL, &nNumFonts);

where cbFontData is 4164 on both machines.
However, on some machines this returns NULL (since a while) and i cannot figure why.

Edit 2:
On those machines, even a direct call to ::AddFontMemResourceEx with a system font as parameter fails, so it must have to do something with the environment.

Here's some testcode:
const char* fonthexascii1 = "4D 5A F7 …… no more space here but that's a ascii hex Dump of a installed small ttf font, in this case VGAFIX.FON, which Ends with … E4 04 00 00 00 00
int size = 0;
char* binfont = new char[1024 * 100]; // qnd; more than enough..
auto binfontIt = binfont;
for (char const* cur = fonthexascii1; *cur != 0; cur += 3)
{
*binfontIt = std::stoi(cur, nullptr, 16);
++binfontIt;
++size;
}

DWORD nNumFonts = 0;
HANDLE hMemFont = ::AddFontMemResourceEx((void*)binfont, DWORD(size), NULL, &nNumFonts);

Solution:
https://docs.microsoft.com/en-us/windows/security/threat-protection/block-untrusted-fonts-in-enterprise" rel="nofollow - https://docs.microsoft.com/en-us/windows/security/threat-protection/block-untrusted-fonts-in-enterprise




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