level 2
------解决方案--------------------
使用标准资源读取方法找到字体资源,例如
HINSTANCE hInstRes = NULL or the dll/exe that contains the font resource;
HRSRC hRsrc = hFindResource(hInstRes, _T("the private font name") or ID_MYFONT, RT_FONT);
DWORD cbSize = SizeofResource(hInstRes, hRsrc);
HGLOBAL hMem = LoadResource(hInstRes, hRsrc);
LPVOID pvData = LockResource(hMem);
DWORD nFontsInstalled = 0;
HANDLE hFontInstalled = AddFontMemResourceEx(pvData, cbSize, NULL, &nFontsInstalled);
// OK使用字体。
CreateFont(...);
// 最后删除字体资源。
RemoveFontMemResourceEx(hFontInstalled);
2020年04月25日 01点04分