473,796 Members | 2,618 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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(Tru e), InterfaceType(C omInterfaceType .InterfaceIsIUn known),
Guid("FC4801A3-2BA9-11CF-A229-00AA003D7352")> _

Public Interface IObjectWithSite

Sub SetSite(<Marsha lAs(UnmanagedTy pe.IUnknown)> ByVal pUnkSite As Object)

Sub GetSite(ByRef riid As Object, <MarshalAs(Unma nagedType.Inter face)> 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 2293
<ComVisible(Tr ue), InterfaceType(C omInterfaceType .InterfaceIsIUn known),
Guid("FC4801 A3-2BA9-11CF-A229-00AA003D7352")> _

Public Interface IObjectWithSite

Sub SetSite(<Marsha lAs(UnmanagedTy pe.IUnknown)> ByVal pUnkSite As Object)

Sub GetSite(ByRef riid As Object, <MarshalAs(Unma nagedType.Inter face)> 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.o rg> wrote in message
news:uf******** *****@TK2MSFTNG P14.phx.gbl...
<ComVisible(Tr ue), InterfaceType(C omInterfaceType .InterfaceIsIUn known),
Guid("FC4801 A3-2BA9-11CF-A229-00AA003D7352")> _

Public Interface IObjectWithSite

Sub SetSite(<Marsha lAs(UnmanagedTy pe.IUnknown)> ByVal pUnkSite As Object)

Sub GetSite(ByRef riid As Object, <MarshalAs(Unma nagedType.Inter face)> 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
2308
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 very kindly make available a DLL (the browser helper DLL) which allows you to trap and disable the context menu (right mouse click) and various 'built-in' browser accelerators (such as ctrl+P which brings up the print dialogue, and F5, which will...
4
6192
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 writing Mozilla/Netscape plugins. All I've really managed to find so far is that they are sometimes called Browser Helper Objects, and I'm not even positive on that one. Thanks!
1
1170
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 (http://www.yahoo.com/) is made in IE, I want my DLL routine or my EXE should be called.. So, how to do that, any suggestion will be highly appreciated... -- Jigar Mehta
9
3349
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 visible to a client using a browser. My question is...can a knowledgeable browser user view Jscript source code in an asp file?
2
1556
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
1265
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
5736
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 simplest form, a BHO is a COM in-
2
507
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 defined <ComVisible(True), InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("FC4801A3-2BA9-11CF-A229-00AA003D7352")> _ Public Interface IObjectWithSite Sub SetSite(<MarshalAs(UnmanagedType.IUnknown)> ByVal pUnkSite As Object)
0
1286
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 clicks this icon, it will open a specified URL in a window. I am new to windows programming. I did some search and found some examples on the internet such as the one posted on codeprojects (http://www.codeproject.com/cs/samples/autosig.asp). ...
0
10459
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10237
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10018
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9055
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6795
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5446
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5578
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3735
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2928
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.