Page 1 of 1

Error loading TCustomRVFormattedData from Stream

Posted: Mon Jul 27, 2009 6:21 pm
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.

Posted: Tue Jul 28, 2009 9:33 am
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.