View Single Post
  #1  
Old 10-08-2009, 01:45 PM
aberbotimue aberbotimue is offline
Junior Member
 
Join Date: Oct 2009
Posts: 8
Question create richtext at runtime, in web app

Hi all...

Can anyone point me in the right direction..

I am running a very quick cgi web application.. but require a print out as an rtf..

in a stand alone app I drop the richtext componant on, and it does what it needs, and then prints, like i want it to.

in the web app, I have to create it at run time.. so I have

Code:
 
with TRichedit.Create(self) do
try
  Visible := false;
  lines.loadfromfile('c:\formations\testfile.rtf');
  // Print('Printer');
finally
   Free;
end;
this gives me an error like

Code:
Internal Application Error
 
Control '' has no parent window
after some time with my good freind google, I found loads saying its about allocating an appropriate parent

so I added

Code:
  parent := self;
 
and tried
 
  parent := nil;
 
even tried   parent := application.webform;
all giving me compile errors.. as you may have guessed, i am a weekend coder, not doing this day in day out...

can anyopne give me that special line I need!

Cheers all

Aber
Reply With Quote