Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Exception??? with COM server and REPORT form
Message
 
To
14/10/2002 13:39:51
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00711026
Message ID:
00711205
Views:
7
Alex,

See inline comments...

> The code works like a charm if the object is called within Fox interface,
> it generates the PDF without problems... but when called via ISAPI it just
> dies in lala land...

I assume your calling the object via COM within Fox. This is always a good test before testing on the web. You should also test your COM inside of ASP:
<%
 Dim oPrint
 Set oPrint = Server.CreateObject("MyProject.ClassName")
 oPrint.MyPrintMethod()
%>
Make sure your COM object has an Error method and makes a call to COMRETURNERROR(). This will trap most errors and helps prevent trips to lala land.

Make sure you set your default directory and path in the Init (or somewhere early on) in the COM server. If you don't, your COM server will be running from your System folder. You can use _VFP.ServerName to determine your component's path.
 PROCEDURE Init
   SET DEFAULT TO (JUSTPATH(_VFP.ServerName))
 ENDPROC
Run the DCOMCNFG.EXE and find your Component. Select the Properties button and then the Security tab. Make sure IUSR*, IWAM* and System users are included in the Access and Launch permissions. For testing purposes, you may want to go to the Identity tab and set the user to the Interactive user. This will let you know if you have a permissions problem.

> I read some stuff... that it creates a COM exception... because of the
> dialog window that the reporter creates... is that right? and if so... is
> there any way of circumventing this particular problem? or I should just
> forget REPORT form... and also probably Foxpro.

You can run a FoxPro report in an out of process COM component (EXE), the dialog will pop up, but that is not a problem.

Usually the problem with a Fox report via COM is permissions or lax error trapping. You have to be very careful that no errors occur in your report, report errors do not get trapped in an error handler. They pop-up a modal dialog and hang your application.

> P.S. worse than that when I disable any user interaction...
> i.e. use of SYS(2335,0)
> it comes back with a funky error that operation is not allowed.

SYS(2335,0) works good for trapping modal situations, but must be turned off before issuing the REPORT FORM command.

Hope this helps,
Bo Durban
Previous
Reply
Map
View

Click here to load this message in the networking platform