Hi Guys,
Is there any way how you can get the values of processID and threadID (P-005448 T-004740) from your program?
Thank you!
Which platform and which version of Progress?
10.2B GUI on Windows:
MESSAGE System.Diagnostics.Process:GetCurrentProcess ():Id
VIEW-AS ALERT-BOX INFO BUTTONS OK.
I don't think the Thread ID is relevant for the Progress client - since it's single threaded.
Thank you, but unfortunately we still on OpenEdge 10.1C04
I don't think the Thread ID is relevant for the Progress client - since it's single threaded.
I want to use this in my "LOG-MANAGER" to see which AppServer agent made changes. Since LOG-MANAGER:LOGFILE-NAME cannot be changed in AppServer env, I need to "Reinvent the wheel" and design my own log-manager (for my specific task).
Thank you!
In Windows you can get these values using this:
/* Get Process ID */PROCEDURE GetCurrentProcessId EXTERNAL "Kernel32.dll":
DEFINE RETURN PARAMETER viProcessID AS LONG.
END./* Get Thread ID */
PROCEDURE GetCurrentThreadId EXTERNAL "Kernel32.dll":
DEFINE RETURN PARAMETER viProcessID AS LONG.
END.
One can find a lot of that sort of thing here http://www.oehive.org/win32api
One might want a different return variable for the second one.
Getting the equivalent in Unix is very straightforward.
But, note Mike's dubiousness about the usefulness of thread ID in a single threaded AVM.