Rynardald
Rynardald

Reputation: 359

How to load resources in a FMX-component

I try to use resources in a FMX-Component and get the EResNotFound-Error when I try to read the resource.

following scenario:

Upvotes: 0

Views: 1927

Answers (2)

Rynardald
Rynardald

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

David Heffernan
David Heffernan

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

Related Questions