473,323 Members | 1,537 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,323 software developers and data experts.

Browser Helper Objects

I am trying to make use of BHO's (and no not to write spyware). It seems all
articles relate to C++, whereas my background si in VB.Net
I've managed to understand that I need the following i/face defined

<ComVisible(True), InterfaceType(ComInterfaceType.InterfaceIsIUnknown ),
Guid("FC4801A3-2BA9-11CF-A229-00AA003D7352")> _

Public Interface IObjectWithSite

Sub SetSite(<MarshalAs(UnmanagedType.IUnknown)> ByVal pUnkSite As Object)

Sub GetSite(ByRef riid As Object, <MarshalAs(UnmanagedType.Interface)> ByVal
ppvSite As Object)

End Interface

But

I have also added the registry entry using the GUID from the assembly.vb
file, but what escapes me is how to have the browser invoke the code so I
can step through / interrogate the value?

Does anyone have a real step by step guid to getting the basics to work
using VB.net?
Jul 21 '05 #1
2 2258
<ComVisible(True), InterfaceType(ComInterfaceType.InterfaceIsIUnknown ),
Guid("FC4801A3-2BA9-11CF-A229-00AA003D7352")> _

Public Interface IObjectWithSite

Sub SetSite(<MarshalAs(UnmanagedType.IUnknown)> ByVal pUnkSite As Object)

Sub GetSite(ByRef riid As Object, <MarshalAs(UnmanagedType.Interface)> ByVal
ppvSite As Object)

End Interface
You don't need to mark the interface as ComVisible, but you should use
the ComImport attribute.

The first parameter of GetSite should be a Guid, not an Object. The
second parameter should be passed ByRef.

I have also added the registry entry using the GUID from the assembly.vb
file, but what escapes me is how to have the browser invoke the code so I
can step through / interrogate the value?


I believe the object should be created and called whenever you open a
browser window. But of course, that only works if your interface
declaration is correct.

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Jul 21 '05 #2
Mattias, many thanks for the guidence.

Regards
"Mattias Sjögren" <ma********************@mvps.org> wrote in message
news:uf*************@TK2MSFTNGP14.phx.gbl...
<ComVisible(True), InterfaceType(ComInterfaceType.InterfaceIsIUnknown ),
Guid("FC4801A3-2BA9-11CF-A229-00AA003D7352")> _

Public Interface IObjectWithSite

Sub SetSite(<MarshalAs(UnmanagedType.IUnknown)> ByVal pUnkSite As Object)

Sub GetSite(ByRef riid As Object, <MarshalAs(UnmanagedType.Interface)> ByValppvSite As Object)

End Interface


You don't need to mark the interface as ComVisible, but you should use
the ComImport attribute.

The first parameter of GetSite should be a Guid, not an Object. The
second parameter should be passed ByRef.

I have also added the registry entry using the GUID from the assembly.vb
file, but what escapes me is how to have the browser invoke the code so I
can step through / interrogate the value?


I believe the object should be created and called whenever you open a
browser window. But of course, that only works if your interface
declaration is correct.

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Andrew Mayo | last post by:
(note: reason for posting here; browser helper object is written in C++; C++ developers tend to know the intricacies of message handling; this looks like a Windows messaging issue) Microsoft...
4
by: Alan D. | last post by:
Hello. I was wondering if anybody had any good resources on creating browser plugins using C#. Right now I'm only worried about Internet Explorer plugins as I already have some documentation on...
1
by: Jigar Mehta | last post by:
Hye, I am trying to get notification of any browser request... (not only that of the local server.. so filters will not be the right way to solve problem) So, whenever any request like...
9
by: WRH | last post by:
Hello I am new to asp but I made some Jscript functions which work fine. The functions contain some strings used as a registration key for some apps. It is important that these strings not be...
2
by: Joe Johnston | last post by:
I need a Browser Helper object written in VB. Please point me at a good example. Joe MCPx3
3
by: Joe Johnston | last post by:
I need a Browser Helper object written in VB.NET. Please point me at a good example. Joe MCPx3
8
by: Joe Johnston | last post by:
I need a Browser Helper object written in VB.NET Please point me at a good example. Joe MCPx3 ~ Hoping this MSDN ng three day turnaround is true. Additional info: What is a BHO? In its...
2
by: JohnFol | last post by:
I am trying to make use of BHO's (and no not to write spyware). It seems all articles relate to C++, whereas my background si in VB.Net I've managed to understand that I need the following i/face...
0
by: qwu2008 | last post by:
All, I wanted to create a browser helper object that has a clickable icon at the right corner of the browser (similar to the Google notebook icon at the right corner of the browser). When the user...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.