Link to home
Start Free TrialLog in
Avatar of Dale Fye
Dale FyeFlag for United States of America

asked on

LoadPicture error with icon files

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).
Avatar of Nick67
Nick67
Flag of Canada image

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?
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/
ASKER CERTIFIED SOLUTION
Avatar of DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Dale Fye

ASKER

Still looking into this.
I've requested that this question be deleted for the following reason:

Not enough information to confirm an answer.
Thanks for the help on this, Joe.