Solved

ISAPI DLL's and (yes) VCL objects

Posted on 1998-10-21
5
299 Views
Last Modified: 2010-04-06
Is it possible to create a VCL object, like a TChart, from within an ISAPI DLL, giving it a 'parent' and calling it's methods to save to a graphic file (of course so I can stream the chart, as a jpeg eventually, back to the happy browser)???  Seems we would just need a valid parent for the TChart, and that's the hitch.  I.e., can another object be the parent (nil don't work), perhaps some non-visual TForm derivative??  Need an approach here, or even an unrelated solution method.

Thanks, experts.  This would be very cool, indeed!
0
Comment
Question by:daviscon
  • 3
  • 2
5 Comments
 

Author Comment

by:daviscon
Comment Utility
Ground-breaking?  No, just a nice way to do web-based database with graphs...
0
 
LVL 12

Expert Comment

by:rwilson032697
Comment Utility
Any container VCL object (such as a TForm, TPanel, TGroupBox etc) can be the parent of a TChart component.

You could certainly create a hidden form and use this as the parent of the TChart component.

eg:
var
  MyForm : TForm;
  MyChart : TChart;
.
  MyForm := Application.CreateForm(TForm, MyForm);
  MyChart := TChart.Create(MyForm);
  MyChart.Parent := MyForm;
// And away you go...

Cheers,

Raymond.

0
 

Author Comment

by:daviscon
Comment Utility
Tapplication.Createform is not possible since this is a TWebModule and not a TApplication as the defines are different.  Your code in an ISAPI WebModule causes this error"

[Error] SPDB.pas(89): Incompatible types: 'TForm' and 'procedure, untyped pointer or untyped parameter'

which indicates that the ISAPIApp and HTTPApp sources for a TWebModule do not support this.  I agree that it should be doable, but I don't want to incurr the overhead of including (even if it works, which I'm not sure it would) TApplication just to declare a container object.  Maybe what's needed is a container that is 'lighter'...

Thanks for your response.  I'll try anything that's suggested with appreciation.

Ed
0
 
LVL 12

Accepted Solution

by:
rwilson032697 earned 100 total points
Comment Utility
Hmm..., try it this way: (modifying my original)

eg:
       var
         MyForm : TForm;
         MyChart : TChart;
       .
         MyForm := TForm.Create(Nil);
         MyChart := TChart.Create(MyForm);
         MyChart.Parent := MyForm;

        // And away you go...

Does this improve things?

Raymond.
0
 

Author Comment

by:daviscon
Comment Utility
Nice work!  I had failed in my earlier attempts at identical code to add the line assigning Parent to the chart, thinking Owner would be all that was needed!

Thanks again for a fast and effective response!

Ed
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now