I try to connect to connection point

invoke CoInitialize, 0
invoke CoCreateInstance, addr CLSID_InternetExplorer, NULL,
addr IID_IWebBrowser2, addr ppv

coinvoke ppv, IWebBrowser2, Visible_put, VARIANT_TRUE
coinvoke ppv, IWebBrowser2, Offline_put, VARIANT_FALSE
coinvoke ppv, IWebBrowser2, Navigate2, addr v1, addr v2, addr v2, addr v2, addr v2
coinvoke ppv, IWebBrowser2, StatusText_get, addr statstr
coinvoke ppv, IWebBrowser2, Document_get, addr pDisp

[b]; QueryInterface return FAILED
coinvoke pDisp, IDispatch, QueryInterface, addr IID_IHTMLDocument2, addr pHtmlDoc
coinvoke ppv, IWebBrowser2, Quit
invoke SysFreeString, urlstr
coinvoke ppv, IWebBrowser2, Release
invoke CoUninitialize

Source code here
Sorry for my English :)
Posted on 2005-01-16 22:46:40 by fvk
this looks fine, and works for me. I'm not familar with that coinvoke macro, you can get the IHTMLDocument2 interface directly from the IDispatch object returned by get_Document:

	lea	eax, hcomDoc2

push eax
push offset idIHTMLDocument2
push hcomIDispDoc
mov eax, hcomIDispDoc
call [eax + idisp_QueryInterface]

if this does fail, your document may be not ok, or some special document, like XML or file protocol or something...
Posted on 2005-01-19 06:31:22 by beaster
Are you tryint to start IExplorer. Try the ComTool. This will start IExplorer.

.model flat, stdcall ;32 bit memory model
option casemap :none ;case sensitive

include windows.inc
include kernel32.inc
include user32.inc
include Comctl32.inc
include shell32.inc
include ole32.inc
include oleaut32.inc

includelib kernel32.lib
includelib user32.lib
includelib Comctl32.lib
includelib shell32.lib
includelib ole32.lib
includelib oleaut32.lib


IDD_DIALOG1 equ 101
IDC_BTN1 equ 1001
IDC_BTN2 equ 1002

szIExplorer db "InternetExplorer.Application",0
IID_IWebBrowserApp GUID {00002DF05h,00000h,00000h,{0C0h,000h,000h,000h,000h,000h,000h,046h}}

hInstance dd ?
pIWebBrowserApp dd ?


invoke GetModuleHandle,NULL
mov hInstance,eax

invoke InitCommonControls
invoke CoInitializeEx,0,0 ;COINIT_MULTITHREADED
invoke DialogBoxParam,hInstance,IDD_DIALOG1,NULL,addr DlgProc,NULL
invoke ExitProcess,0

DlgProc proc hWin:HWND,uMsg:UINT,wParam:WPARAM,lParam:LPARAM
LOCAL lpWideCharStr[128]:byte

mov eax,uMsg

.elseif eax==WM_COMMAND
mov edx,wParam
movzx eax,dx
shr edx,16
.if edx==BN_CLICKED
.if eax==IDC_BTN1
invoke MultiByteToWideChar,CP_ACP,0,addr szIExplorer,-1,addr lpWideCharStr,sizeof lpWideCharStr
invoke CLSIDFromProgID,addr lpWideCharStr,addr clsidApp
invoke CoCreateInstance,addr clsidApp,0,CLSCTX_SERVER,addr IID_IWebBrowserApp,addr pIWebBrowserApp
.if eax==S_OK
mov eax,pIWebBrowserApp
mov edx,[eax]
push pIWebBrowserApp
;call IWebBrowserApp.put_Visible
call dword ptr [edx+41*4]

.elseif eax==IDC_BTN2
mov eax,pIWebBrowserApp
mov edx,[eax]
push pIWebBrowserApp
;call IWebBrowserApp._Quit
call dword ptr [edx+32*4]
.if eax==S_OK
invoke IDispRelease,addr pIWebBrowserApp

.elseif eax==WM_CLOSE
invoke EndDialog,hWin,0
mov eax,FALSE
mov eax,TRUE

DlgProc endp

IDispRelease proc uses edi esi edx pClass:dword

mov eax,pClass
mov eax,dword ptr [eax]
mov edx,dword ptr [eax]
push eax ;pClass
;call pClass._Release
call dword ptr [edx+2*4]
.if eax==0
mov eax,pClass
mov dword ptr[eax],0
IDispRelease endp

end start
Posted on 2005-01-19 09:58:32 by minor28