Board index » delphi » Form resource to dfm

Form resource to dfm


2003-12-30 12:43:58 AM
delphi229
This might not be an OpenTools issue, and it might as well be impossible,
but I have to make sure before just throwing away the idea.
We are developing a project that will end up with different users using
different form layouts, to accomplish this we are using the IDE to design
forms, and we added a menu item thru OpenTools to save the active form to a
resource file, and the resource file is loaded at runtime by the
constructor.
When we have to make changes to a form layout we have to be able to load the
resource file back to dfm to be able to make the changes within the IDE and
save it back to a resource. This could be accomplished using
ReadComponentRes and then ObjectResourceToText, but in order to do this the
FormClass being loaded has to be registered, and this prevents having a
compiled package used by OpenTools to load any form. So I was wondering if
it's possible to register classes at runtime by trying to intercept the
raised error of "Class not Registered" and registering the class.
As I am afraid this can not be accomplished, I'd appreciate any other idea
that would accomplish my goal.
Thanks for reading till here, and thanks in advance for any help.
-Jack
 
 

Re:Form resource to dfm

Jack writes:
Quote
As I am afraid this can not be accomplished, I'd appreciate any
other idea that would accomplish my goal.
The problem is that the exception returns the class name as a string
and you would normally use FindClass to retrieve the class type, but
since the class isn't registered...
How about calling RegisterClass[es] for the classes in the
initialization code of the expert? Yes, there are probably a lot of
classes to call it for, but I can not think of any other way myself.
--
Cheers,
Ignacio
 

Re:Form resource to dfm

Quote
How about calling RegisterClass[es] for the classes in the
initialization code of the expert? Yes, there are probably a lot of
classes to call it for, but I can not think of any other way myself.
The problem is that forms (classes) could be added at any time, and I want
this procedure to work for them even if they weren't known at the time the
expert was compiled.
-Jack