"A call to an OS function failed."
A user reports getting the message "A call to an OS function failed." when
printing. The call stack shows the following:
TppReport.print
TppProducer.print
TppProducer.print
TppProducer.printToPrinter
TppProducer.printToPrinter
TppProducer.doOnPrintDialogCreate
TppCommunicator.sendEventNotify
User32.dll GetTitleBarInfo
User32.dll IsWindowVisible
I deduce from this that windows is trying to show a print dialog and is
failing somehow. The environment is MS Terminal Services.
Anything I can do about this?
Jeremy
printing. The call stack shows the following:
TppReport.print
TppProducer.print
TppProducer.print
TppProducer.printToPrinter
TppProducer.printToPrinter
TppProducer.doOnPrintDialogCreate
TppCommunicator.sendEventNotify
User32.dll GetTitleBarInfo
User32.dll IsWindowVisible
I deduce from this that windows is trying to show a print dialog and is
failing somehow. The environment is MS Terminal Services.
Anything I can do about this?
Jeremy
This discussion has been closed.
Comments
This may have something to do with the fact that you are running this report
on a terminal service. Try changing your library path to
\RBuilder\Source\... and see if you can trace where the problem is occuring
in the RB source code.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
GetTitleBarInfo was called from line 765, which is the "begin" statement. I
don't understand how that can be, but I don't have a terminal services
environment where I can run the debugger. I've advised the user to check
with their IT folks, and if they are previewing, to try printing directly
(which might avoid the dialog).
Developed in RBE7, D7.
Jeremy
procedure TppCommunicator.SendEventNotify(aCommunicator: TppCommunicator;
aEventID: Integer; aParams: TraParamList);
var
liIndex: Integer;
lCommunicator: TppCommunicator;
liSaveCount: Integer;
begin
if (FEventNotifyList = nil) then Exit;
liIndex := 0;
while (FEventNotifyList <> nil) and (liIndex < FEventNotifyList.Count) do
begin
lCommunicator := TppCommunicator(FEventNotifyList[liIndex]);
liSaveCount := FEventNotifyList.Count;
if (aEventID in lCommunicator.EventNotifies) then
lCommunicator.EventNotify(aCommunicator, aEventID, aParams);
if (FEventNotifyList <> nil) and (FEventNotifyList.Count =
liSaveCount) then
Inc(liIndex);
end;
end; {procedure, SendEventNotify}
Thanks for the info. Does this error occur when printing any report? Have
your customers every been able to successfully see the print dialog? Are
you able to recreate this issue using RB 9.01?
As a workaround, you can avoid showing the print dialog all together by
setting the TppReport.ShowPrintDialog property to False.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
printer is assigned in the termserv environment.
Bernd