Connect Presentation Space (1)

Top  Previous  Next

The Connect Presentation Space function establishes a connection between your EHLLAPI application program and the host presentation space.








Prerequisite Calls


There are no prerequisite calls for this function.



Call Parameters



Standard Interface

Enhanced Interface

Function Number

Must be 1


Data String

1-character short name of the host presentation space



1 is implied

Must be 4

PS Position




The calling data string can contain:










A 1-character presentation space short name (PSID)






Return Parameters


The Connect Presentation Space function sets the return code to indicate the status of the attempt and, if successful, the status of the host presentation space.


Return Code



The Connect Presentation Space function was successful; the host presentation space is unlocked and ready for input.


An incorrect host presentation space ID was specified. The specified session either does not exist or is a logical printer session. This return code could also mean that the API Setting for DDE/EHLLAPI is not set on.


Successful connection was achieved, but the host presentation space is busy.


Successful connection was achieved, but the host presentation space is locked (input inhibited).


A system error was encountered.


This resource is unavailable. The host presentation space is already being used by another system function.





1.The Connect Presentation Space function is affected by the CONLOG/CONPHYS session option.
2.An EHLLAPI application cannot be connected to multiple presentation spaces concurrently. Calls requiring the Connect Presentation Space function as a prerequisite use the currently connected presentation space. For example, if an application is connected to presentation space A, B, and C in that order, the application must connect to B or A again to issue functions.
3.Each thread that requests a Connect Presentation Space must have a corresponding Disconnect Presentation Space (2), or one of the threads must issue a Reset System (21), which affects all threads and disconnects any remaining connections.
4.More than one EHLLAPI application can share a presentation space, if the applications support sharing (that is, if they were developed to work together and if they exhibit predictable behavior) and have compatible read/write access and keyword options as set in the Set Sessions Parameters (9) function. For more information, see Set Session Parameters (9).
5.Because the Connect Presentation Space and Start Keystroke Intercept (50) functions share common subsystem functions, successful requests by an application to share either of these functions for the same session can affect the request of these two functions by other applications. For example, if application A successfully requests a Connect Presentation Space for a session with Write_Read access and KEY$abcdefgh as the keyword, a request by application B to Connect Presentation Space for a session and Start Keystroke Intercept is successful only if both applications have set compatible read/write options.