(ActiveX) Implementing a Browser Helper Object

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

(ActiveX) Implementing a Browser Helper Object

Yar Hwee Boon-3
Hi all

I've been trying to implement a Browser Helper Object (BHO) using
Dolphin XP Pro after reading the posts regarding recommended steps, by
Blair etc. Basically I run

1. Produce IDL
2. Run midl on the IDL to generate the type lib (BHOLib)
3. Use the ActiveX Component Wizard to generate the stub for the
interface (IObjectWithSite)
4. Add a AXDualImp subclass (coclass MyBHO) to implement that
interface (IObjectWithSite).
5. Send #registerClassFactory to the Smalltalk class (COMMyBHO)
implementing the coclass.
6. Run a vb test client that created an instance with the following
code.
=====
Dim Bho As FYPLib.MyBHO
Set Bho = New FYPLib.MyBHO
=====

The code ran ok. However, when I changed it to the following, I got
the runtime error 429.
=====
Dim Bho As FYPLib.MyBHO
Set Bho = CreateObject("FYP.MyBHO.1")
=====

I then did the following, error 429 was removed.
=====
COMMyBHO register: (OLEConstants at: #CLSCTX_LOCAL_SERVER)
=====


My 1st question is.. so far, does what I did sound right? Especially
the #register to enable me to use the progID for creation? 2nd
question.., after this, I added the following registry key to install
my BHO.
======
HKLM {
 SOFTWARE {
  Microsoft {  
   Windows {
    CurrentVersion {
     Explorer {
      'Browser Helper Objects' {UUID of coclass goes here}
=======

However, when I start Internet Explorer 6, the BHO does not seems to
be instantiated. I have added a self halt to
COMClassFactory#createInstance: and left the Dolphin env running, it
never ran to that line. FWIW, another plain BHO that I have coded in
Delphi and compiled into a DLL runs fine.

Any suggestion on how I can debug this? I am quite clueless in ActiveX
development.. in case there was any blantant mistake. Thanks in
advance.

HweeBoon