Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - V17 on Win10 doesn't show "..." on PGrid Btns
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

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

 Post Reply Post Reply
Author
Message
liong View Drop Down
Newbie
Newbie
Avatar

Joined: 13 August 2019
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote liong Quote  Post ReplyReply Direct Link To This Post Topic: V17 on Win10 doesn't show "..." on PGrid Btns
    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:

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