LoadPicture error with icon files

Dale Fye
Dale Fye used Ask the Experts™
on
I'm completing an Access add-in which provides a visual interface for creating shortcut menus.

I am using the LoadPicture method to load image files into the Picture property of shortcut menu controls and this works great for jpg, bmp, and gif files, but not with icon files.  Every question I've looked at on all of the various on-line forums indicates that icon files in 16x16 or 32x32 are acceptable with True Colors or 256 color attributes, but every icon file I try to upload fails and raises an undocumented error (#-2140724809).
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2014

Commented:
For giggles.
Rename the .ico file to .bmp or to .jpg.
Will it load?
Image support has varied greatly over the years with Access.
Go far enough back and only .bmp was usuable.
Sometimes, without the old Office Picture Manager installed, that was even the case in A2003.

I haven't tried loading an icon file with WIA yet.
It certainly can get done via WinAPI.
Have you tried the simple stuff first?
Most Valuable Expert 2014

Commented:
What you may be hitting too is an .ico file with multiple sizes rolled in.
Those may not play nice with Access
http://icoconvert.com/Multi_Image_to_one_icon/
Database Architect / Application Developer
Top Expert 2007
Commented:
I would seriously look at Gunter's Ribbon Creator code ... he had help from other peeps with the image stuff.
Pretty sure your answer is there. Loads ICO's and all other image types with no issue.
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Dale FyeOwner, Dev-Soln LLC
Most Valuable Expert 2014
Top Expert 2010

Author

Commented:
Still looking into this.
Martin LissOlder than dirt
Most Valuable Expert 2017
Distinguished Expert 2018

Commented:
I've requested that this question be deleted for the following reason:

Not enough information to confirm an answer.
Dale FyeOwner, Dev-Soln LLC
Most Valuable Expert 2014
Top Expert 2010

Author

Commented:
Thanks for the help on this, Joe.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial