CreateSession
Description
Creates an IPB_Session object that can be used to call
PowerBuilder functions.
Syntax
|
1 |
CreateSession(LPCTSTR applicationName, LPCTSTR* libraryList, pbuint numLibs, IPB_Session** session) |
|
Argument |
Description |
|---|---|
|
applicationName |
The name of the current application object in |
|
libraryList |
The library list of the PowerBuilder application |
|
numLibs |
The number of libraries in the library |
|
session |
A pointer to IPB_Session*, which will return the |
Return value
PBXRESULT. PBX_OK for success.
Examples
This example creates an IPB_Session with the simple library list
mydemo.pbl:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
IPB_Session* session; IPB_VM* vm = NULL; fstream out; ifstream in; PBXRESULT ret; HINSTANCE hinst=LoadLibrary("pbvm.dll"); if ( hinst== NULL) return 0; out<< "Loaded PowerBuilder VM successfully!"<<endl; P_PB_GetVM getvm = (P_PB_GetVM)GetProcAddress (hinst, "PB_GetVM"); if (getvm == NULL) return 0; getvm(&vm); if (vm == NULL) return 0; static const char *liblist[] = { "mydemo.pbl" }; ret= vm->CreateSession("mydemo", liblist, 1, &session); if (ret != PBX_OK) { out << "Create session failed." << endl; return 0; } out << "Create session succeeded!" <<endl; |
See also
Document get from Powerbuilder help
Thank you for watching.
Subscribe
Login
0 Comments
Oldest