Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 307
  • Last Modified:

ISAPI DLL's and (yes) VCL objects

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
daviscon
Asked:
daviscon
  • 3
  • 2
1 Solution
 
davisconAuthor Commented:
Ground-breaking?  No, just a nice way to do web-based database with graphs...
0
 
rwilson032697Commented:
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
 
davisconAuthor Commented:
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
 
rwilson032697Commented:
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
 
davisconAuthor Commented:
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now