
char *text="星际冒险v2";
if (DDS[SBuffer]->GetDC(&hdc) == DD_OK)
{
SetBkMode(hdc,TRANSPARENT);
SetTextColor(hdc, RGB(200, 250, 100));
TextOut(hdc,0,0, text, strlen(text));//参数4出错
DDS[SBuffer]->ReleaseDC(hdc);
}
error C2664: 'TextOutW' : cannot convert parameter 4 from 'char *' to 'LPCWSTR'
请各位帮忙给个解决方案!程序必须使用 Unicode 字符集.
char *text="星际冒险v2";
修配搜改为:
wchar_t* text = L"星枣梁际冒险v2";
strlen(text)
修改为凳卖运:
wcslen(text)
OK