Question

While opening a dfm file by double clicking, I am getting following error:

Class TMyClass not found. Ignore the error and continue? Note: Ignoring the error may cause components to be deleted or property values to be lost.

When I click Cancel, I get following message

Error creating form: Class TMyClass not found.

When I click OK now, pas file is opened only.

In pas file MyClass unit is added (which conatins the TMyClass defination) and its path is also added in my search path (Ctrl clicking on unit name, takes me to the unit file)

Everything is fine as per me. I don't know why I am getting this error and why am I not able to open this dfm file in RAD studio? Please help.

Was it helpful?

Solution

To create the component (that you placed on the form) Delphi IDE should know it by name and have its class loaded into memory. That means - it should have that component compiled into binary runtime package and that corresponding design-time package should be loaded into IDE and during the loading it should call RegisterComponent.

Usually this all is done during the library installation. So if you have that library for Delphi 7 now just install it for Delphi XE4 as well.

If your library does not have installer or that installer does not know XE4, then you have to register those components manually, just like Delphi documentations asks you to do. That is a multi-step process, so you maybe would need to re-do it from starters. However with any luck you would probably be able to reuse the work already done for Delphi 7. At best case you only would have to recompile runtime and designtime packages in XE4 and then install those design-time ones into newer IDE.

OTHER TIPS

This problem occurred to me after a new version of Windows 10; I adjusted by changing the permissions of my executable. I just removed the notification permissions and added it again;

https://support.microsoft.com/en-us/windows/change-notification-settings-in-windows-10-ddcbbcd4-0a02-f6e4-fe14-6766d850f294 for more details;

For me, this error happen when a visual control was declared as TSomething in the pas file and as TSomethingElse in the DFM file.

The solution was to manually edit the DFM file and put the control declaration to the correct value (TSomething).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top