Board index » cppbuilder » ReadComponent and WriteComponent
Andrew
![]() CBuilder Developer |
ReadComponent and WriteComponent2003-08-16 09:58:41 PM cppbuilder83 Hi, I asked a similar question a while ago, but I didn't get a reply so I'll state the question in another way and hope that someone can help me. I am trying to stream a form to a file, which I successfully do. Then I try and stream it and all of its properties back at a later stage. I keep getting an exception saying that "Panel1 already exists". Panel1 is a component on the form. I use the following code: Saving: if (SaveDialog->Execute()) { TFileStream *fileStream = new TFileStream(SaveDialog->FileName, fmCreate); fileStream->WriteComponent(SurnameCrit); delete fileStream; ShowMessage("Criteria saved."); } Loading: if (OpenDialog->Execute()) { TFileStream *fileStream = new TFileStream(OpenDialog->FileName, fmOpenRead); fileStream->ReadComponent(SurnameCrit); delete fileStream; } Am I missing a concept about streaming or something? If no one can help me, can someone at least refer me to a good TFileStream help source which I also don't seem to find. Thanks for your help! |