The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: ragdog on March 06, 2007, 06:40:46 PM

Title: webbrowser-control
Post by: ragdog on March 06, 2007, 06:40:46 PM
hi @all

I  have a problem with my webcontrol !

if I insert a webbrowser-control into my resource started my prog no more! have you any idea?

thanks in forward
ragdog

[attachment deleted by admin]
Title: Re: webbrowser-control
Post by: u on March 06, 2007, 08:41:52 PM
Just move the

       invoke LoadLibrary,offset szDLL
       mov hLib,eax
    invoke GetProcAddress,hLib,addr szAtlAxWinInit
       call eax   

right after "invoke InitCommonControls"
and it'll work :)
Though it'll crash on dialog-closing, not sure why ^^'
Ah... didn't read long enough to see you call FreeLibrary before the window is actually deleted. So, replace your source.asm with

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

include source.inc

.code

start:
invoke GetModuleHandle,NULL
mov hInstance,eax
invoke InitCommonControls
       invoke LoadLibrary,offset szDLL
       mov hLib,eax
    invoke GetProcAddress,hLib,addr szAtlAxWinInit
       call eax   

       
invoke DialogBoxParam,hInstance,IDD_DIALOG,NULL,addr DlgProc,NULL
invoke FreeLibrary,hLib
invoke ExitProcess,0

DlgProc proc hWnd:HWND,uMsg:UINT,wParam:WPARAM,lParam:LPARAM       
xor eax, eax
.if uMsg == WM_CLOSE
invoke EndDialog,hWnd,0
mov eax,1
.endif
 
ret
DlgProc endp

end start
Title: Re: webbrowser-control
Post by: hutch-- on March 07, 2007, 07:40:38 AM
You may need to use InitCommonControlsEx.
Title: Re: webbrowser-control
Post by: ragdog on March 07, 2007, 03:50:52 PM
thanks :U

I can also thereby with which sendmessage function send a URL address at the windows?


ragdog