The MASM Forum

General => The Workshop => Topic started by: jj2007 on July 27, 2012, 07:39:41 AM

Title: WebBrowser control
Post by: jj2007 on July 27, 2012, 07:39:41 AM
Many of you are probably aware of JIE, Japheth's Internet Explorer, http://www.japheth.de/dwnload1.html - look for JIE inside the page:
QuoteJIE: is - like OCX Container - an ActiveX control container, but with special adjustments for hosting the IE WebBroser control. This makes this sample a very small, but fully functional WebBrowser. It's Public Domain and uses the WinInc (http://www.japheth.de/WinInc.html) include files.
Source code is in IEContainerSample.zip (http://www.japheth.de/Download/Samples/IEContainerSample.zip)
The archive contains the executable, a 9kByte file that is remarkably close to a real browser ;-)

Question: Has anybody managed to assemble & link the source...??
Assembly works for me, but the linker throws errors:
POLINK: error: Unresolved external symbol '_DestroyWBContainer@4'.
POLINK: error: Unresolved external symbol '_CreateWBContainer@4'.

Title: Re: WebBrowser control
Post by: qWord on July 27, 2012, 07:53:26 AM
works fine after correcting some errors in eventobj.asm (the loacal vt is incorrectly used in the function Invoke_)
Title: Re: WebBrowser control
Post by: jj2007 on July 27, 2012, 07:59:58 AM
What the heck is VARIANTARG??
Without your corrections, do you get the same linker errors?
Title: Re: WebBrowser control
Post by: qWord on July 27, 2012, 08:09:46 AM
VARIANT types are used by COM objects and allow to safely exchange arbitrary data.
I do not get any linker error, but I also use the libraries from the Windows SDK.
Title: Re: WebBrowser control
Post by: Ryan on July 27, 2012, 09:46:18 AM
The two procs in question are defined in container.asm.  You'll have to assemble all the .asm files, and then link all their .obj files... I think.  I'm still working through it.
Title: Re: WebBrowser control
Post by: Ryan on July 27, 2012, 10:19:51 AM
I'm stuck on
        mov ecx,vt.byref
        mov [ecx].VARIANT_BOOL, VARIANT_TRUE


VARIANT_BOOL is defined as SWORD in wtypes.inc.  How does that apply in the dereferencing of ecx?

EDIT: This is in the Invoke_ proc about line 256 in eventobj.asm.
2: I think it should be boolVar instead of VARIANT_BOOL.  It occurred to me to look at the VARIANT structure, and boolVar has that type.
Title: Re: WebBrowser control
Post by: qWord on July 27, 2012, 10:48:55 AM
Quote from: Ryan on July 27, 2012, 10:19:51 AMVARIANT_BOOL is defined as SWORD in wtypes.inc.  How does that apply in the dereferencing of ecx?
This is because it is an pointer to VARIANT_BOOL (SWORD) -> NewWindow3 event (http://msdn.microsoft.com/en-us/library/aa768288(v=vs.85).aspx)
Title: Re: WebBrowser control
Post by: Ryan on July 27, 2012, 10:49:59 AM
Does it assemble for you?  My assembler doesn't like it.
Title: Re: WebBrowser control
Post by: qWord on July 27, 2012, 10:53:38 AM
yes, but jwasm warns about the missing size information -> you must cast it to a WORD:
mov [ecx].VARIANT_BOOL, WORD ptr VARIANT_TRUE
Title: Re: WebBrowser control
Post by: Ryan on July 27, 2012, 10:57:15 AM
The macro assembler doesn't like that either.

Microsoft (R) Macro Assembler Version 6.14.8444
Copyright (C) Microsoft Corp 1981-1997.  All rights reserved.

Assembling: C:\masm32\IEContainer\eventobj.asm
C:\masm32\IEContainer\eventobj.asm(258) : error A2166: structure field expected

Title: Re: WebBrowser control
Post by: qWord on July 27, 2012, 11:06:49 AM
sorry, it should be:
mov WORD ptr [ecx],VARIANT_TRUE
Title: Re: WebBrowser control
Post by: Ryan on July 27, 2012, 11:43:04 AM
Thanks qWord.  That worked.

I got an .exe out of it.  It took a few modifications.  That must be the difference between JWasm and masm.