CString strs;
strs="hhh";
wchar_t thisChar;
for(int i=0;i<sizeof(strs);i++)
thisChar = strs.GetAt(i);
GetGlyphOutlineW的第二个参数 UINT nChar。
我不管,拷来的程序定义wchar_t,保留。
———————————分割线—————————————
输入3个及以上字符的时候没大问题,输入两个会弹出Debug Assertion Failed!
//for(int i=0;i<sizeof(strs);i++)
for(int i=0;i<strs.GetLength();i++)
thisChar = strs.GetAt(i);
试了
DWORD returnBytes = GetGlyphOutlineW(pDC->GetSafeHdc(), strs.GetAt(i), GGO_NATIVE, &gm, sizeof(buffer), buffer,&mat2);
可以直接传递。