问题
How do i develop a addon for ie in .net. I am basically looking to develop a inline spell checking addon like IE7Pro.
回答1:
Check this out: Developing IE Add-ons
回答2:
You might want to try: http://code.msdn.microsoft.com/SpicIE
But in general witting managed add-ons isn't ideal as .net is not in process side by side. So if another add-on uses .net then the first add-on to load determines the .net version that's used by other add-ons which can quickly cause issues.
回答3:
You would need to create a EXE/DLL masquerading as a COM object i.e. a CCW (COM Callable Wrapper) which on both sides of .NET and COM it looks like a native COM object that implements IDispatch, IUnknown interfaces and numerous others as well.
You must adhere to the COM interfaces in order for IE to be able to 'see' your .NET code. However I cannot provide the details for IE in terms of what interfaces does it require in order for IE to call your .NET runtime methods as this is beyond me.
But the important keyword here is CCW. Here is an article on CodeProject that shows how it can be done, though not neccessarily about creating an IE Addon but will show how to create a CCW.
It is accomplished by setting a attribute on your classes and methods.
[Guid(some_guid)] [InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
some_guid as illustrated above would be generated via VS's 'Create GUID' tool under Tools menu.
Depending on what IE requires to hook up to your .NET classes, it will see it as a 'native' COM object with IUnknown, IDispatch interfaces to name but a few
Hope this will give you the right direction and hint, Best regards, Tom.
来源:https://stackoverflow.com/questions/1840803/ie-addon-development-in-net