Reputation: 359
I try to use resources in a FMX-Component and get the EResNotFound-Error when I try to read the resource.
following scenario:
TResourceStream.Create(FindClassHInstance(TPmFmxTitelbar), 'ImgOptions', RT_RCDATA);
I get the error EResNotFound 'resource ImgOptions not found'Upvotes: 0
Views: 1927
Reputation: 359
ok, I solved this problem.
I added the 'FmxComponents.dres' to my component with {$R FmxComponents.dres}
.
I thought that it is enough to add this in the dpk-file.
Upvotes: 1
Reputation: 613302
The first parameter of the TResourceStream
constructor is the instance of the module which is searched for the resources. So, if you've really linked the resources correctly, using the correct type and name, then one would assume that you are passing the wrong module instance.
So, perhaps the module that implements the misspelled TPmFmxTitelbar
is not the module to which the resources are linked.
If you really are passing the right module instance, then the remaining conclusion is that you are failing to link resources with the specified type and name. Use a resource viewer/editor to check that.
Upvotes: 0