RipBucks
asked on
Delphi XE LoadFromResourceName resource not found
I have created a component inherited from an image button. I have added the up and down images to the resource image list using the 'Project|Resources and Images' menu option .
the bitmaps appear in the Project Manager and it all compiles an installs just fine.
When I use the button in my project there are no errors and the button image is used when viewed in the design window.
My project compiles just fine but when I try to open the window when running the program it give an error:
the create code for the button is:
constructor TSMfcImageBtn.create(aowne r:tcompone nt);
var
buttonup,buttondown : Tbitmap;
begin
inherited;
try
buttonup := Tbitmap.Create;
buttonup.LoadFromResourceN ame(hInsta nce,'Butto nUp');
image.loadfrombitmap(butto nup);
buttondown := Tbitmap.Create;
buttondown.LoadFromResourc eName(hIns tance,'But tonDown');
imagedown.loadfrombitmap(b uttondown) ;
finally
buttonup.Free;
buttondown.Free;
end;
offsets.GlyphX := 0;
offsets.GlyphY := 0;
offsets.ImageDownX := 0;
offsets.ImageDownY := 0;
offsets.TextDownX := 0;
offsets.TextDownY := 0;
offsets.TextX := 0;
offsets.Texty := 0;
end;
Any ideas
the bitmaps appear in the Project Manager and it all compiles an installs just fine.
When I use the button in my project there are no errors and the button image is used when viewed in the design window.
My project compiles just fine but when I try to open the window when running the program it give an error:
the create code for the button is:
constructor TSMfcImageBtn.create(aowne
var
buttonup,buttondown : Tbitmap;
begin
inherited;
try
buttonup := Tbitmap.Create;
buttonup.LoadFromResourceN
image.loadfrombitmap(butto
buttondown := Tbitmap.Create;
buttondown.LoadFromResourc
imagedown.loadfrombitmap(b
finally
buttonup.Free;
buttondown.Free;
end;
offsets.GlyphX := 0;
offsets.GlyphY := 0;
offsets.ImageDownX := 0;
offsets.ImageDownY := 0;
offsets.TextDownX := 0;
offsets.TextDownY := 0;
offsets.TextX := 0;
offsets.Texty := 0;
end;
Any ideas
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Add Windows in uses.
ASKER
So I can't test if this is a solution