64,654
社区成员
发帖
与我相关
我的任务
分享
LRESULT lRes;
DWORD dwRes;
SendMessageTimeout( hWndChild, nMsg, 0L, 0L, SMTO_ABORTIFHUNG, 1000, &dwRes);
lRes = dwRes;
HRESULT hr;
hr = (*pfObjectFromLresult)(lRes, IID_IHTMLDocument, 0, (void**)&spDoc );
2. 否则的话,不能用这种SendMessageTimeout的方法返回处理结果,需要其他的方法!PDWORD_PTR lRes;
SendMessageTimeout( hWndChild, nMsg, 0L, 0L, SMTO_ABORTIFHUNG, 1000, reinterpret_cast<PDWORD_PTR>(&lRes) );
但根据MSDN上说的,第七个参数是[out] Pointer to a DWORD that receives the result of the message processing. This value depends on the message that you send.
既然这样说了,那跟DWORD有何区别呢?而且我后面的程序需要使用到这个LRESULT,那该如何是好,将PDWORD_PTR类型转成LRESULT?好像不是很实际
HRESULT hr;
hr = (*pfObjectFromLresult)(lRes, IID_IHTMLDocument, 0, (void**)&spDoc );
DWORD dwRes;
SendMessageTimeout( hWndChild, nMsg, 0L, 0L, SMTO_ABORTIFHUNG, 1000, &dwRes);