0

我正在修改 MSDN 上的 STablUpd 代码示例(用于编辑资源中的字符串表)但是,我遇到了一些错误。

错误所在的代码是

HSTRBLOCK strBlock = GetStringBlockW( L"file.exe", 7, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_UK) );
UINT str1Len;
GetStringLength( strBlock, str1Len );
LPWSTR pszString1;
GetStringW(strBlock, 6, pszString1 );
MessageBox(NULL, (LPCSTR) pszString1, NULL, NULL);

我收到的错误如下

Error   4   error C2065: 'pszString1' : undeclared identifier   tabledlg.c  190 1   STablUpd
Error   5   error C2065: 'pszString1' : undeclared identifier   tabledlg.c  191 1   STablUpd
Error   8   error C2065: 'pszString1' : undeclared identifier   tabledlg.c  192 1   STablUpd
Error   3   error C2146: syntax error : missing ';' before identifier 'pszString1'  tabledlg.c  190 1   STablUpd
Error   2   error C2275: 'LPWSTR' : illegal use of this type as an expression   tabledlg.c  190 1   STablUpd

请任何人指出这是否有任何错误,我已经检查过,但代码对我来说似乎很好。

任何帮助表示赞赏。

4

1 回答 1

1

似乎LPWSTR没有定义。要么您缺少include,要么您包含该文件,但某些预处理器指令排除了该类型。

有关更多信息,请参阅内容。

于 2012-10-31T15:16:47.890 回答