Solved

ISAPI DLL's and (yes) VCL objects

Posted on 1998-10-21
5
303 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
ID: 1343827
Ground-breaking?  No, just a nice way to do web-based database with graphs...
0
 
LVL 12

Expert Comment

by:rwilson032697
ID: 1343828
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
ID: 1343829
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
ID: 1343830
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
ID: 1343831
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

713 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