Error loading TCustomRVFormattedData from Stream

General TRichView support forum. Please post your questions here
Post Reply
zehdopulo
Posts: 9
Joined: Wed Jul 22, 2009 12:54 pm

Error loading TCustomRVFormattedData from Stream

Post by zehdopulo »

I have the follow code:

Code: Select all

void TForm::AddHeader(TCustomRVFormattedData *aSrc, TCustomRVFormattedData *aDest)
{
  TMemoryStream *ms = new TMemoryStream;
  aSrc->SaveRVFToStream(ms, false, NULL, NULL, NULL);
  ms->Position = 0;
  aDest->InsertRVFFromStream(ms, aDest->ItemCount, NULL, NULL, NULL, false); //generates exception EClassNotFound
  delete ms;
}
aSrc parameter are from RichViewEdit->RVData that have controls, like TPanel, TEdit, TLabel, etc... and generates EClassNotFound with the message "Class TPanel Not Found". How do I fix it?
PS: Previously, I was setted RVData aSrc as my header of RVPrint.
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Call
RegisterClass(__classid(TPanel))
one time before the first loading. Call RegisterClass for all types of controls that can be in your documents.
Post Reply