P4210 - One session per Workstasion. is it possible ?

iwanb

Member
Hi,
Is it possible to setting 1 interactive program in one workstation, only can
access that program in one session ?
If it is possible, how can I do that ?

Ex. like this : user can only run P4210 one session in his/her computer. They
can't run P4210 again if there is still P4210 active in their computer.

I'm using JDE Oneworld, B7334.

Thanks for response.
Iwan Budiman
 
Yes, it's possible on a Fat Client.

Look up the FindWindowEx API in MSVC (C++) helps. It's quite simple actually.

Use it something like this in a new BSFN:
FindWindowEx(MDIDialogWnd, NULL,NULL,"Sales Order Detail Revisions");

If the window is found then the program is running; press the 'cancel' button when the bsfn returns. I guess you'd find two since the second one is the new instance.

I wrote a dialog program that waits in memory and watches for Sales Order Entry to start. When it does, the dialog shows up and accepts input from the user. It's pretty slick, but the 'HTML only' path obsoleted the whole project. :mad: :mad:
 
I like the idea of searching for windows.

But there is an alternative:

Create a work file with having the following unique key:
UserName
MachineId

Upon loading P4210, simply do this:
Fetch from the table
If the record exists, trigger "Close"
If the record does not exist, write the record

Upon Application Exit: delete the record

Chances are the P4210 WILL crash someday. You might need a browse application with DELETE capabilities to "unlock" your users.

As an alternative (if you like coll stuff like finding a window with win32 api's), you might also hack the jdeInitEnvBSFN (B0000182 ), which is called upon entry in the system, to delete the record in the file. I have never done it in the past, but this is technically possible, since the OCM is already loaded at the moment the function is called.

Bus as you see, there is no "out of the box" solution to the problem...
 
Back
Top