Retrieve Process ID / Client ID from Procedure editor V8.3C

Fredmeu

New Member
Hi all,

Does anyone know if it is possible to somehow retrieve
the current session Process ID or Client ID in the editor
(i.e. through handles or VST... Progress V8.3C)

Other suggestions on how to quickly distinguish
user sessions are very welcome...

Fred v.d. Meulen
 
Hi,

1. In V8 you can use the GetCurrentProcessId API call to retreive the PID and find your _Connect record. Example:

DEFINE VARIABLE intProcessHandle AS INT NO-UNDO.

PROCEDURE GetCurrentProcessId EXTERNAL "KERNEL32.DLL":
DEFINE RETURN PARAMETER intProcessHandle AS LONG.
END PROCEDURE.

RUN GetCurrentProcessId (OUTPUT intProcessHandle).

FIND FIRST _connect WHERE _connect-pid = intProcessHandle NO-LOCK NO-ERROR.
DISPLAY _connect.


2. In V9 you can use _MyConnection VST. Example:
find first _MyConnection.
display _MyConnection.


Best regards,
Gabor
 

Fredmeu

New Member
Thanks Gabor,

It worked perfectly..... and solved my problem...

However its a pity that we still have to make use
of API calls to get this info, preventing Progress'
power of OS platform-independence.... I'm happy
to see this has been changed in V9......:D

Fred
 
Top