Hi timovjl, yes, you're right. Should be only:
#define COBJMACROS
#include <objidl.h>
#include <exdisp.h>
#include "iehelp.h"
#include <mshtml.h>
Here's the code with the calls:
...
char * docStr;
HRESULT hr;
IHTMLElementCollection ** plnIHTMLElementCollection;
IDispatch ** ppDisp;
IHTMLDocument2 * plnIHTMLDocument2;
IWebBrowser2 * ipBrowser;
ipBrowser = (IWebBrowser2 *)GetWindowLong(hwnd,GWL_USERDATA);
IWebBrowser2_get_Document(ipBrowser, ppDisp);
hr = Dispatch_QueryInterface(ppDisp, IID_IHTMLDocument2, plnIHTMLDocument2);
if (hr == S_OK){
hr = IHTMLDocument2_get_all(plnIHTMLDocument2, plnIHTMLElementCollection);
if (hr == S_OK){
IHTMLElementCollection2_toString(plnIHTMLElementCollection, docStr);
MessageBox(0, "docStr=", docStr, MB_OK);
}
}
...
Actual build output:
Building WEBBROWSER.OBJ.
...WEBBROWSER.C(91): warning #2027: Missing prototype for '_Dispatch_QueryInterface'.
...WEBBROWSER.C(95): warning #2027: Missing prototype for '_IHTMLElementCollection2_toString'.
Building BrowsApp.EXE.
POLINK: error: Unresolved external symbol '__Dispatch_QueryInterface'.
POLINK: error: Unresolved external symbol '__IHTMLElementCollection2_toString'.
POLINK: fatal error: 2 unresolved external(s).
*** Error code: 1 ***
Done.
Thanks