How to retrieve user ID from within C bsfn

Andrew2009

Well Known Member
Let's say I log into JDE with user ID of "JOHN". How do I get this user id in a C bsfn?


HUSER huser = NULL;

JDB_InitBhvr((void*)lpBhvrCom, &hUser, (JCHAR *) NULL, JDEDB_COMMIT_AUTO);


Thanks

TR: 9.1.4.7 On Windows
 
DB_RTN (PJSTR) JDEWINAPI JDB_GetUser( HENV hEnv );

In all usages of this I've seen, hEnv is passed in as NULL.

Craig

 
You can use B9800100 function, or you can get the user directly without using the COK just like that function from the lpBhvrCom->SysPref.szUserName.

Cheers,
 
JCHAR szUserName = lpBhvrCom->SysPref.szUserName is the easiest way, IMO, as AlexRO suggested.
 
Back
Top