Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

"A call to an OS function failed."

edited March 2005 in General
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

Comments

  • edited March 2005
    Hi Jeremy,

    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.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited March 2005
    Nico, here is the proc. EurekaLog's call stack claims User32.dll's
    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}



  • edited March 2005
    Hi Jeremy,

    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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited March 2005
    I am not sure, but I seem to recall that this happens when no default
    printer is assigned in the termserv environment.

    Bernd

This discussion has been closed.