PB_GetVM
Description
Passes the IPB_VM interface to the user.
Syntax
|
1 |
PB_GetVM (IPB_VM** vm) |
Examples
This example loads the PowerBuilder VM and calls the
f_getrowcount function on the nvo_dw custom class user object:
|
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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
#include <pbext.h> #include <iostream.h> typedef PBXEXPORT PBXRESULT (*P_PB_GetVM)(IPB_VM** vm); class LibraryLoader { public: LibraryLoader(LPCSTR libname) { d_hinst = LoadLibrary(libname); } ~LibraryLoader() { FreeLibrary(d_hinst); } operator HINSTANCE() { return d_hinst; } private: HINSTANCE d_hinst; }; int main() { int int_rowcount; PBXRESULT ret; LibraryLoader loader("pbvm.dll"); if ((HINSTANCE)loader == NULL) return 0; P_PB_GetVM getvm = (P_PB_GetVM) GetProcAddress((HINSTANCE)loader, "PB_GetVM"); if (getvm == NULL) return 0; IPB_VM* vm = NULL; getvm(&vm); if (vm == NULL) return 0; static const char *liblist[] = { "load_pbvm.pbl" }; IPB_Session* session = NULL; ret = vm->CreateSession ("load_pbvm", liblist, 1, &session); if (ret!= PBX_OK) { cout << " Create session failure!" << endl; return 0; } return 1; } |
Usage
To load the PowerBuilder VM and run a PowerBuilder application in
a third-party server or application, you first create an IPB_VM object
using the PB_GetVM method. Then, create an IPB_Session object within
IPB_VM, using the application’s name and library list as
arguments.
See also
Document get from Powerbuilder help
Thank you for watching.
Subscribe
Login
0 Comments
Oldest