CreateSession

PowerBuilder Native Interface

IPB_VM interface:

CreateSession method

Description

Syntax

CreateSession(LPCTSTR   applicationName, LPCTSTR* libraryList, pbuint numLibs, IPB_Session**   session)

Return Values

Examples

IPB_Session* session;
IPB_VM* vm = NULL;
fstream out;
ifstream in;
PBXRESULT ret;

HINSTANCE hinst=LoadLibrary("pbvm170.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