Access violation

edited 8:24AM in FastReport 3.0
A Have Access violation with this example code:

AnsiString form=ExtractFilePath(Application->ExeName)+"\\Forms\\exam.fr3";
frxReport1->LoadFromFile(form, True);
// frxReport1->PrepareReport();
((TfrxMemoView*)frxReport1->FindObject("MemoTo1"))->Text =
Edit1->Text.SubString(1,1).Trim();
// frxReport1->PrepareReport();
frxReport1->ShowReport();

I thing that problem is this line:
((TfrxMemoView*)frxReport1->FindObject("MemoTo1"))->Text =
Edit1->Text.SubString(1,1).Trim();

Please help. What I am doing wrong?
Stan

Comments

  • edited April 2006
    Report can't find object with name "MemoTo1".
    TfrxMemoView * memo;
    if(NULL==(memo = (TfrxMemoView*)frxReport1->FindObject("MemoTo1"))) //if memo = NULL then report can't find object
    memo->Text = Edit1->Text.SubString(1,1).Trim();
    
    frxReport1->ShowReport();
    

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.