maddman

I have built a BHO based on this article and it works great, but I cannot deploy it to machines that do not have Visual Studio 2005. It won't register and I have fixed all the errors that Dependency Walker showed.

Has anyone else had problems deploying

Murph



Re: Internet Explorer Extension Development New MSDN BHO Article - Building Browser Helper Objects with Visual Studio 2005

John Sudds - MSFT

Build with Release project settings before deploying the BHO.

The Debug project settings create dependencies on the debug versions of DLLs, which are not normally present on systems without Visual Studio. In addition, VS2005 enforces the use of side-by-side assemblies (WinSxS) making it harder to install missing DLLs. By default, the compiler combines the manifest file with the DLL as a resource; although you can change project settings to create an external file, you cannot disable this feature.

If you are still having trouble, install the MSVCRT redistributable package on the target machine.

http://msdn2.microsoft.com/en-us/library/ms235624(VS.80).aspx






Re: Internet Explorer Extension Development New MSDN BHO Article - Building Browser Helper Objects with Visual Studio 2005

maddman

Are you meaning, build with 'Release' settings, not 'Debug' Because I can't find anyplace in VS2005 that would have a 'Retail' setting. Maybe I am missing something. I will try your other suggestion and install the MSVCRT package, and let you know how that goes.

Thank you for your help, I know you and Tony are really busy.

Murph





Re: Internet Explorer Extension Development New MSDN BHO Article - Building Browser Helper Objects with Visual Studio 2005

maddman

Man, I have followed every single MSDN page out there on this topic.

Here is my embedded Manifest:

<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.VC80.CRT" version="8.0.50727.762" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.VC80.ATL" version="8.0.50727.762" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
</dependentAssembly>
</dependency>
</assembly>

The RT_MANIFEST is a 2, as it should be. I have ran the vcredist_x86.exe on the target PC. I have used Dependency Walker to verify all dependencies are there...The only problem I see with that is, right on top it says it can't find msvcr80.dll, then below it, it says, c:\windows\winsxs\x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_6b128700\MSVCR80.DLL. How can it not find it, then say it found it

Anyway, So far I am amazed people are still having problems with DLL's. Maybe this should be called "DLL Hell...Side-by-Side". I am also amazed that there are so many people who work for Microsoft who can't seem to help on this.





Re: Internet Explorer Extension Development New MSDN BHO Article - Building Browser Helper Objects with Visual Studio 2005

maddman

I want to issue a challenge to anyone who can follow this article and build the DLL:

http://msdn.microsoft.com/library/default.asp url=/library/en-us/IETechCol/cols/dnexpie/expie_hello_bho.asp then deploy the DLL to a non-VS2005 Windows XP machine.

The person who could figure it out, would be a genius.





Re: Internet Explorer Extension Development New MSDN BHO Article - Building Browser Helper Objects with Visual Studio 2005

John Sudds - MSFT

Yes, I meant to say "Release" not "Retail." (Fixed above.) Old habits die hard.

I would also be interested to know if anyone else is having trouble. I have deployed the BHO to a Windows XP SP2 Pro box without VS2005 and it worked for me--but there may be trouble if the target system isn't running the latest service pack. See http://channel9.msdn.com/ShowPost.aspx PostID=23261.

BTW, the best way to deploy is with a standalone setup that includes the appropriate merge modules. (It's not as hard as you might think.)

http://msdn2.microsoft.com/en-us/library/ms235317(VS.80).aspx

Also, make sure you take the time (it's a doozie) to install the latest service pack for Visual Studio 2005:

http://www.microsoft.com/downloads/details.aspx familyid=BB4A75AB-E2D4-4C96-B39D-37BAF6B5B1DC&displaylang=en






Re: Internet Explorer Extension Development New MSDN BHO Article - Building Browser Helper Objects with Visual Studio 2005

Tom McAnnally

You are dependent upon ATL8. If you static link to ATL8, and install the Visual Studio Runtime, it will work.



Re: Internet Explorer Extension Development New MSDN BHO Article - Building Browser Helper Objects with Visual Studio 2005

peterlubs

okay I'm not a "genius" but this isn't that hard to fix so it can be deployed via a simple "regsrv32 myBHO.dll" to IE 6 via a VS2005 SP1 build:

1. Turn off the "embed manifest" as stated above in the project properties, manifest tool, input/output.
2. Use depends to find out what else you are dynamically linking to. Probably the CRT and ATL. Unless you want to ship all that, make them static.




Re: Internet Explorer Extension Development New MSDN BHO Article - Building Browser Helper Objects with Visual Studio 2005

maddman

Nope that didn't work either....I would love to email the project to someone and have you tell me exactly what to do to get it to work.

Ok...I fired up VS2005, said new C++ project, ATL Project...compiled....copied to a non-VS2005 computer...and failed registering. Dependency Walker says I am missing DWMAPI.dll.





Re: Internet Explorer Extension Development New MSDN BHO Article - Building Browser Helper Objects with Visual Studio 2005

zeltera

The same problem here: I coded a BHO (in c#) and I want to run it on other computers. And I cannot. I mean, it runs, but not completely. In any computer without Visual Studio, my BHO runs partial.

I have a lot of MessageBox.Show - to help me to understand what's happened in a computer that have no development tools installed.

The green code never executed - and this is good, because that code means exceptions - cached errors
The blue code got executed - this is also good... means that IE run that code!
The red code never executed - is red only in DocumentCompleted function, that is the function that run when the browser finished to load the page! This is wrong, because that part, in my computer, development computer, run. Only in computers without Visual Studio is not running!

Any suggestion What do am I missing

The code for this BHO is:


My BHO code - almost all

[ComVisible(true)]
[Guid("0A39EB4C-A152-439c-9A82-15936A2C895C")]
[ClassInterface(ClassInterfaceType.None)]
public class MyBHO : IObjectWithSite
{
WebBrowser webBrowser;
HTMLDocument document;

#region IObjectWithSite Members

public int SetSite(object site)
{
System.Windows.Forms.MessageBox.Show("Entered in SetSite");
if (site != null)
{
try
{
System.Windows.Forms.MessageBox.Show("1");
webBrowser = (WebBrowser)site;
System.Windows.Forms.MessageBox.Show("webBrowser: " + webBrowser.FullName);
webBrowser.DocumentComplete += new DWebBrowserEvents2_DocumentCompleteEventHandler(this.OnDocumentComplete);
System.Windows.Forms.MessageBox.Show("DocumentComplete");
webBrowser.BeforeNavigate2 += new DWebBrowserEvents2_BeforeNavigate2EventHandler(this.OnBeforeNavigate2);
System.Windows.Forms.MessageBox.Show("BeforeNavigate2");
}
catch (Exception ex)
{
System.Windows.Forms.MessageBox.Show(ex.Message);
}


}
else
{
webBrowser.DocumentComplete -= new DWebBrowserEvents2_DocumentCompleteEventHandler(this.OnDocumentComplete);
webBrowser.BeforeNavigate2 -= new DWebBrowserEvents2_BeforeNavigate2EventHandler(this.OnBeforeNavigate2);
webBrowser = null;
}
return 0;
}

public int GetSite(ref Guid guid, out IntPtr ppvSite)
{
System.Windows.Forms.MessageBox.Show("Entered in GetSite");
IntPtr punk = Marshal.GetIUnknownForObject(webBrowser);
int hr = Marshal.QueryInterface(punk, ref guid, out ppvSite);
Marshal.Release(punk);
return hr;
}

#endregion

#region BrowserEvents

void OnDocumentComplete(object pDisp, ref object URL)
{
System.Windows.Forms.MessageBox.Show("Entered in OnDocumentComplete");
}

public void OnBeforeNavigate2(object pDisp, ref object URL, ref object Flags, ref object TargetFrameName, ref object PostData, ref object Headers, ref bool Cancel)
{
System.Windows.Forms.MessageBox.Show("Entered in OnBeforeNavigate2");
}


#endregion

#region ComRegisterFunction
public static string BHOKEYNAME = "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Browser Helper Objects";

[ComRegisterFunction]
public static void RegisterBHO(Type t)
{
RegistryKey key = Registry.LocalMachine.OpenSubKey(BHOKEYNAME, true);
if (key == null)
{
key = Registry.LocalMachine.CreateSubKey(BHOKEYNAME);
}

string guidString = t.GUID.ToString("B");
RegistryKey bhoKey = key.OpenSubKey(guidString, true);

if (bhoKey == null)
{
bhoKey = key.CreateSubKey(guidString);
}

// NoExplorer:dword = 1 prevents the BHO to be loaded by Explorer
string _name = "NoExplorer";
object _value = (object)1;
bhoKey.SetValue(_name, _value);
bhoKey.SetValue("Alright", 1);

key.Close();
bhoKey.Close();
}

[ComUnregisterFunction]
public static void UnregisterBHO(Type t)
{
RegistryKey key = Registry.LocalMachine.OpenSubKey(BHOKEYNAME, true);
string guidString = t.GUID.ToString("B");

if (key != null)
{
key.DeleteSubKey(guidString, false);
}
}

#endregion
}







Re: Internet Explorer Extension Development New MSDN BHO Article - Building Browser Helper Objects with Visual Studio 2005

maddman

I finally found a correct version of C++ Redist that works. Check the microsoft website and install the latest version. It worked for me.