Kevin Cochran
6/27/2007 11:44:00 PM
Greetings,
I am trying to make a custom download manager in c#. The code compile, I
register it with gacutil and regasm, but when I open IE and click on a link
to download, I get the standard IE download dialog. Is there something I'm
missing? I am new to COM, so any help would be appreciated. Here is my
complete code:
/* BEGIN CODE */
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
using System.Windows.Forms;
namespace MyDownloader
{
[ComImport, GuidAttribute("988934A4-064B-11D3-BB80-00104B35E7F9"),
InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown),
ComVisible(false)]
public interface IDownloadManager
{
void Download(
System.Runtime.InteropServices.ComTypes.IMoniker pmk,
System.Runtime.InteropServices.ComTypes.IBindCtx pbc,
UInt32 dwBindVerb,
Int32 grfBINDF,
IntPtr pBindInfo,
String pszHeaders,
String pszRedir,
UInt32 uiCP
);
}
[ComImport, Guid("988934A4-064B-11D3-BB80-00104B35E7F9")]
public interface Downloader
{
}
[Guid("78BC4A4C-63B7-41CC-B287-858663AF4281"),
ClassInterface(ClassInterfaceType.None)]
public class MainClass : IDownloadManager
{
public MainClass()
{
}
public void Download(
System.Runtime.InteropServices.ComTypes.IMoniker pmk,
System.Runtime.InteropServices.ComTypes.IBindCtx pbc,
UInt32 dwBindVerb,
Int32 grfBINDF,
IntPtr pBindInfo,
String pszHeaders,
String pszRedir,
UInt32 uiCP)
{
MessageBox.Show("Got it!");
}
}
}
/* END CODE */
Thanks,
Kevin