Link to home
Start Free TrialLog in
Avatar of daviscon
daviscon

asked on

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!
Avatar of daviscon
daviscon

ASKER

Ground-breaking?  No, just a nice way to do web-based database with graphs...
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.

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
ASKER CERTIFIED SOLUTION
Avatar of rwilson032697
rwilson032697

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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