Instantiate a COM objectint sm_obj_create_server(char *object);
- The service component to instantiate.
sm_obj_create_serverinstantiates a COM service component. It is needed because some COM components cannot be instantiated by sm_obj_create. A notable example is the Crystal Reports
CrystalRuntime.Applicationcomponent. Before invoking this function, you must set
PV_SERVER_COM. This function was first released in Panther 5.10.
// This JPL code assmes that the screen has a Crystal Reports
// 'Crystal ActiveX Report Viewer Control 11.5' ActiveX field
// named 'myReport'.
vars reportObj, applicObj
@app()->current_component_system = PV_SERVER_COM
applicObj = sm_obj_create_server("CrystalRuntime.Application")
// reportPfad is the file name of a Crystal Reports report file.
proc ViewReport (reportPfad)
if applicObj > 0
reportObj = sm_obj_call(applicObj, "OpenReport", reportPfad)
if reportObj > 0
sm_obj_set_property(myReport->id, "ReportSource", reportObj)
sm_obj_call (myReport->id, "ViewReport")