We help IT Professionals succeed at work.

Icons & ActiveX Dlls

paulstamp
paulstamp asked
on
303 Views
Last Modified: 2010-05-02
Is it possible to retrieve an Icon from and ActiveX DLL (I know its possible from an ActiveX EXE, but using the standard methods (see Q185883 on MSDN) using ExtractIcon API I cant get any icons. I have written an ActiveX Dll and specified an icon for it in the project properties page, but ExctactIcon draws a blank.
Anybody succesfully done this in the past, or is VB just conning me by letting me specify an icon for the DLL ?
Comment
Watch Question

Go to vbAccelerator at http://www.vbaccelerator.com/ do a search on Icon Extractor.  You will find an Icon Extractor utility that will extract Icons from DLLs and EXEs.  It also comes with the source code!
You can also just download the file directly from this URL.  By the way this is free the code and application are free!

vbaccelerator.com/codelib/gfx/iconex6.zip

Top Expert 2005

Commented:
In order to add icons to a DLL, you must add a resource file to the project.  The Resource Editor Add-In will allow you to do this.  Once the resource file is part of the project, add as many icons as you wish.  ExtractIcon() will then work with your DLL.

Author

Commented:
The Icon Extractor program will not extract the icon from an ActiveX DLL, however Erick37's suggestion about using a resource file does solve the problem.

Cheers Erick
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
Thanks, although Erick37 also came up with the same solution
Top Expert 2005

Commented:
That's funny.
Olly got the points.

Author

Commented:
Sorry... dont know how to give points except in response to a direct answer. Is there a way of doing that ?
Top Expert 2005

Commented:
Not a problem.
I think there is an "Accept Comment as Answer" option on the comment bars.  But I think you have to reject any pending answers first.
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.