0

これは、OnBtnClick 関数で記述したコードです。

CComPtr<IHTMLDocument3> pDoc3 = (IHTMLDocument3 *)m_webBrowser.get_Document();
CComPtr<IHTMLElement> pElem;
BSTR idTmp = CComBSTR(L"article_summary");
HRESULT hr = pDoc3->getElementById(idTmp, &pElem);

IDが「article_sumary」の要素を取得しようとしています。

Run-Time Check Failure #0 - The value of ESP was not properly saved across a function
call.  This is usually a result of calling a function declared with one calling
convention with a function pointer declared with a different calling convention.
4

1 に答える 1

1

あなたが持っている最初のキャストは厄介に見えます。キャストされていないドキュメント タイプ (IHTMLDocument2 ?) を取得し、それに対して IHTMLDocument3 に対するクエリ インターフェイスを実行します。

CComPtr<IHTMLDocument2> pDoc2 = m_webBrowser.get_Document();// assuming it returns IHTMLDocument2

CComPtr<IHTMLDocument3> pDoc3;
pDoc2->QueryInterface(&pDoc3);
于 2012-07-28T16:04:18.580 に答える