SetAutomationTimeout – PB Docs 126

SetAutomationTimeout PowerScript function

Description

Sets the number of milliseconds that a PowerBuilder client
waits before canceling an OLE procedure call to the server.

Controls

OLEObject objects

Syntax

Argument

Description

oleobject

The name of an OLEObject variable containing
the object for which you want to set the timeout period.

interval

A 32-bit signed long integer value (in
milliseconds) specifying how long a PowerBuilder client waits before
canceling a procedure call. The default value is 300,000 milliseconds
(5 minutes). Specifying 0 or a negative value resets interval to
the default value.

Return Values

Integer. Returns 0 if it succeeds and
-1 if it fails.

Usage

This function passes the value of interval to
PowerBuilder’s implementation of the IMessageFilter interface
and determines how long PowerBuilder tries to complete an OLE procedure
call. The value applies only when PowerBuilder is the OLE client,
not when PowerBuilder is the OLE server.

note.png Default timeout period

For most situations, you do not need to call SetAutomationTimeout.
The default timeout period of five minutes is usually appropriate.
Use SetAutomationTimeout to change the default
timeout period if you expect a specific OLE request to take longer
than five minutes.

If the timeout period is too short, you may get a PowerBuilder
application execution error, R0035. In this case, use SetAutomationTimeout to
lengthen the timeout period.

If the timeout period expires, runtime error 1037 occurs.
You may want to add code to handle this error, which is often the
only indication of a hung server. Note that canceling a transaction
often causes memory leaks on both the server and the operating system.

The value that you specify with SetAutomationTimeout applies
to all OLE transactions in the current session, including calls
that relate to other objects.

Examples

This example calls the ConnectToObject function
to connect to an Excel worksheet and sets a timeout period of 900,000
milliseconds (15 minutes):


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x