1

I have a HTML page with an embedded ActiveX object. This object is referenced as an OBJECT tag.

The activeX handles some data inside a listview-like control. I need to get the data inside that listview control. I use the following code:

  int msg;
  DWORD lRes = NULL ;
  IHTMLDocument2 *pDoc= NULL;
  IHTMLElementCollection *pElement = NULL;
  IDispatch *ppvDisp;
  VARIANT ObjName;
  _variant_t index = NULL;
  HRESULT hr;
  LRESULT lr;
  UINT *cntTypeInf ;

  OleInitialize(NULL);

  msg = RegisterWindowMessage(L"WM_HTML_GETOBJECT");
  lr = SendMessageTimeout(hwnd, msg, 0, 0, SMTO_ABORTIFHUNG, 1000, &lRes);
  hr = ObjectFromLresult((LRESULT)lRes, IID_IHTMLDocument2, 0, (void**)&pDoc);
  hr = pDoc->get_all( &pElement );

  BSTR BStrObjName = _com_util::ConvertStringToBSTR((const char *)"S_DetectCom");
  ObjName.vt = VT_BSTR ;
  ObjName.bstrVal = BStrObjName ;
  hr = pElement->item( ObjName , index , &ppvDisp );
  hr = ppvDisp->GetTypeInfoCount(cntTypeInf);

The ppvDisp is an IDispatch for the object.

I have the dll and its typelib as a resource. What can i do?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.