Author Topic: WebBrowser control  (Read 4799 times)

jj2007

  • Member
  • *****
  • Posts: 8822
  • Assembler is fun ;-)
    • MasmBasic
WebBrowser control
« 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:
Quote
JIE: 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 include files.
Source code is in 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'.


qWord

  • Member
  • *****
  • Posts: 1473
  • The base type of a type is the type itself
    • SmplMath macros
Re: WebBrowser control
« Reply #1 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_)
MREAL macros - when you need floating point arithmetic while assembling!

jj2007

  • Member
  • *****
  • Posts: 8822
  • Assembler is fun ;-)
    • MasmBasic
Re: WebBrowser control
« Reply #2 on: July 27, 2012, 07:59:58 AM »
What the heck is VARIANTARG??
Without your corrections, do you get the same linker errors?

qWord

  • Member
  • *****
  • Posts: 1473
  • The base type of a type is the type itself
    • SmplMath macros
Re: WebBrowser control
« Reply #3 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.
« Last Edit: July 27, 2012, 09:18:54 AM by qWord »
MREAL macros - when you need floating point arithmetic while assembling!

Ryan

  • Guest
Re: WebBrowser control
« Reply #4 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.

Ryan

  • Guest
Re: WebBrowser control
« Reply #5 on: July 27, 2012, 10:19:51 AM »
I'm stuck on
Code: [Select]
        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.

qWord

  • Member
  • *****
  • Posts: 1473
  • The base type of a type is the type itself
    • SmplMath macros
Re: WebBrowser control
« Reply #6 on: July 27, 2012, 10:48:55 AM »
VARIANT_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
MREAL macros - when you need floating point arithmetic while assembling!

Ryan

  • Guest
Re: WebBrowser control
« Reply #7 on: July 27, 2012, 10:49:59 AM »
Does it assemble for you?  My assembler doesn't like it.

qWord

  • Member
  • *****
  • Posts: 1473
  • The base type of a type is the type itself
    • SmplMath macros
Re: WebBrowser control
« Reply #8 on: July 27, 2012, 10:53:38 AM »
yes, but jwasm warns about the missing size information -> you must cast it to a WORD:
Code: [Select]
mov [ecx].VARIANT_BOOL, WORD ptr VARIANT_TRUE
MREAL macros - when you need floating point arithmetic while assembling!

Ryan

  • Guest
Re: WebBrowser control
« Reply #9 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


qWord

  • Member
  • *****
  • Posts: 1473
  • The base type of a type is the type itself
    • SmplMath macros
Re: WebBrowser control
« Reply #10 on: July 27, 2012, 11:06:49 AM »
sorry, it should be:
mov WORD ptr [ecx],VARIANT_TRUE
MREAL macros - when you need floating point arithmetic while assembling!

Ryan

  • Guest
Re: WebBrowser control
« Reply #11 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.