错误 C2027:使用未定义的类型 GUITHREADINFO
在使用 Visual Studio C++ 构建期间,我收到此错误:
error C2027: use of undefined type 'rectAnalyzer::GUITHREADINFO'
函数 rectAnalyzer 如下:
DWORD WINAPI rectAnalyzer(LPVOID param)
{
MSG msg;
PARAM_PASSED *p = (PARAM_PASSED*) param;
std::ostringstream ss;
std::wstring str;
PGUITHREADINFO g = (PGUITHREADINFO) malloc(sizeof(struct GUITHREADINFO));
if(p)
{
ss << "rectAnalyzer: entering thread " << p->index << "->" << p->parentThreadId << std::endl;
str = string2wideString(ss.str().c_str());
OutputDebugString(str.c_str());
PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE);
if(WaitForSingleObject(hStartEvent,INFINITE) != WAIT_OBJECT_0)
return 1;
ss << "rectAnalyzer: thread " << p->index << " sending WM_APP" << std::endl;
str = string2wideString(ss.str().c_str());
OutputDebugString(str.c_str());
if(!GetGUIThreadInfo(p->parentThreadId, g))
{
ss << "rectAnalyzer: unable to get GUI thread info" << std::endl;
str = string2wideString(ss.str().c_str());
OutputDebugString(str.c_str());
}
while(!PostMessage(g->hwndActive, WM_APP, (WPARAM) 0, (LPARAM) 0))
{
ss << "rectAnalyzer: thread " << p->index << " unable to send WM_APP" << std::endl;
str = string2wideString(ss.str().c_str());
OutputDebugString(str.c_str());
Sleep(1);
}
free(p);
}
else
{
ss << "rectAnalyzer: cannot get p" << std::endl;
str = string2wideString(ss.str().c_str());
OutputDebugString(str.c_str());
}
return 0;
}
我还包含了 WinUser.h 或 Windows.h,但没有结果。
during build with Visual Studio C++ I get this error:
error C2027: use of undefined type 'rectAnalyzer::GUITHREADINFO'
the function rectAnalyzer is the following:
DWORD WINAPI rectAnalyzer(LPVOID param)
{
MSG msg;
PARAM_PASSED *p = (PARAM_PASSED*) param;
std::ostringstream ss;
std::wstring str;
PGUITHREADINFO g = (PGUITHREADINFO) malloc(sizeof(struct GUITHREADINFO));
if(p)
{
ss << "rectAnalyzer: entering thread " << p->index << "->" << p->parentThreadId << std::endl;
str = string2wideString(ss.str().c_str());
OutputDebugString(str.c_str());
PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE);
if(WaitForSingleObject(hStartEvent,INFINITE) != WAIT_OBJECT_0)
return 1;
ss << "rectAnalyzer: thread " << p->index << " sending WM_APP" << std::endl;
str = string2wideString(ss.str().c_str());
OutputDebugString(str.c_str());
if(!GetGUIThreadInfo(p->parentThreadId, g))
{
ss << "rectAnalyzer: unable to get GUI thread info" << std::endl;
str = string2wideString(ss.str().c_str());
OutputDebugString(str.c_str());
}
while(!PostMessage(g->hwndActive, WM_APP, (WPARAM) 0, (LPARAM) 0))
{
ss << "rectAnalyzer: thread " << p->index << " unable to send WM_APP" << std::endl;
str = string2wideString(ss.str().c_str());
OutputDebugString(str.c_str());
Sleep(1);
}
free(p);
}
else
{
ss << "rectAnalyzer: cannot get p" << std::endl;
str = string2wideString(ss.str().c_str());
OutputDebugString(str.c_str());
}
return 0;
}
I've included also WinUser.h or Windows.h but with no result.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试使用
sizeof(GUITHREADINFO)
而不是sizeof(struct GUITHREADINFO)
Try using
sizeof(GUITHREADINFO)
instead ofsizeof(struct GUITHREADINFO)