Click here to Skip to main content
15,918,193 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all, I'm trying to develop an add-on for IE, and I want to add browseui.dll to my project, but I can this error message

A reference to "C:\BROWSEUI.DLL" could not be added. Please make sure that the file is accessible, and that is a valid assembly or COM componenet.

Does anyone have idea what's wrong?
Thanks in advance.
Posted
Updated 20-Sep-12 1:53am
v2
Comments
[no name] 20-Sep-12 7:24am    
Sure it's either not a valid .NET assembly or it's not a COM component just like it says.
hahik2001 20-Sep-12 8:31am    
Actually I wanted to use that dll for adding a button to the IE status bar, can I achieve it in another way?
[no name] 20-Sep-12 9:00am    
Try P/Invoke for the functions that you want to use.
Rock (Multithreaded) 20-Sep-12 7:58am    
All dlls are not same.
This is not a valid dll for .net
hahik2001 20-Sep-12 8:31am    
Actually I wanted to use that dll for adding a button to the IE status bar, can I achieve it in another way?

1 solution

If this not a valid .NET assembly or a COM component, you will need to use P/Invoke. To learn it, please see:
http://en.wikipedia.org/wiki/Platform_Invocation_Services[^],
http://msdn.microsoft.com/library/en-us/vcmxspec/html/vcmg_PlatformInvocationServices.asp[^].

This CodeProject article can also be useful:
Essential P/Invoke[^].

Another alternative could be using C++/CLI, especially if the library file is written in C++ or C and you have the header files. You can create additional a mixed-mode project (managed+unmanaged) which would serve as an interface between native unmanaged code and .NET. You can wrap unmanaged code into managed "ref" C++/CLI classes/structures, make public what you need to use, and use the resulting executable as a regular .NET assembly, by referencing it in your C# project. Please see:
http://en.wikipedia.org/wiki/C%2B%2B/CLI[^],
http://www.ecma-international.org/publications/standards/Ecma-372.htm[^],
http://msdn.microsoft.com/en-us/library/xey702bw.aspx[^],
http://msdn.microsoft.com/en-us/library/3bstk3k5[^].

Everything else solely depends on what's in that library.

Good luck,
—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900