473,805 Members | 1,949 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 2295
<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
2309
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
6194
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
1171
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
3351
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
1558
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
1266
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
5737
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
1287
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
9596
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10359
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...
1
10364
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10104
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
9182
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...
1
7645
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6875
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
5677
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3007
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.