NO

Author Topic: 'POLINK: ...Unresolved external symbol...', how do I find which lib/dll to use?  (Read 2063 times)

bob202

  • Guest
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

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 1633
What header file you use ?
May the source be with you

bob202

  • Guest
#define  COBJMACROS

#include <objidl.h>
#include <exdisp.h>
#include "iehelp.h"

#include <oaidl.h>
#include <mshtml.h>
#include <mshtmlc.h>

Thanks

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 1633
Those macros are not defined mshtmlc.h ?

These found:
IHTMLElementCollection_QueryInterface(This,riid,ppvObject)
IHTMLElementCollection_toString()




« Last Edit: July 07, 2010, 02:18:35 pm by timovjl »
May the source be with you

bob202

  • Guest
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

bob202

  • Guest
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.

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 1633
May the source be with you

bob202

  • Guest
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.