foxman_


I'm trying to print a report from a Com dll file.

I keep getting the OLE IDispatch exception code 2031: User-interface operation not allowed at this time.

Is there any way to make this work without building to an .exe file I'm using VFP 9

thanks in advance

-m




Re: Printing from com dll

AndyKr


The error indicates that you are using some form of UI - which is NOT allowed in a VFP DLL.

Are you trying to use the Preview winodow If so you cannot do so unless you re-compile as an EXE and no, there is no way around it. Either dispense with the preview or use the DLL to return the data for the report to the calling application and have IT handle the display and print.

This is built into the compiler for DLLs because a DLL may be running on an unattended server and UI output could hang the entire server!







Re: Printing from com dll

foxman_

Thanks for your reply, Andy.

After your reply we made a getReport( @filefrx, @filefrt, @xml ) return nCounter

It runs the query in the dll and returns the files and resultset by ref. And the number of rows in the resultset.

Then we run the report client-side

-m






Re: Printing from com dll

AndyKr

Nice! Glad I could help




Re: Printing from com dll

Claude Fox

If you are calling from a fox web mtdll(web app or web service), then you'd need to use a work around since you can not issue a REPORT FORM from an mtdll. The workaround is to createobject an .EXE COM server from your fox mtdll and call a method from it that has the REPORT FROM in it...