Pelles C forum
C language => Beginner questions => Topic started by: bob202 on July 07, 2010, 01:12:18 PM
-
I get these errors, so how do I find out which lib(s) or dll(s) to include in the Linker option page?
A previous post suggested looking in the API, but where would I find this API documentation?
-------------------------
POLINK: error: Unresolved external symbol '_Dispatch_QueryInterface'.
POLINK: error: Unresolved external symbol '_IHTMLElementCollection2_toString'.
Thanks
-
What header file you use ?
-
#define COBJMACROS
#include <objidl.h>
#include <exdisp.h>
#include "iehelp.h"
#include <oaidl.h>
#include <mshtml.h>
#include <mshtmlc.h>
Thanks
-
Those macros are not defined mshtmlc.h ?
These found:
IHTMLElementCollection_QueryInterface(This,riid,ppvObject)
IHTMLElementCollection_toString()
-
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
-
corrected output (I tried adding an extra _ character):
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.
-
This compiles without error:
http://www.johnfindlay.plus.com/pellesc/COM/BrowsApp.zip (http://www.johnfindlay.plus.com/pellesc/COM/BrowsApp.zip)
-
Yes, I have tried to add the extra code above to access the DOM document using IDispatch etc. These additional calls give rise to the errors shown.
Yes, I can build the original without any problems.