cancel
Showing results for 
Search instead for 
Did you mean: 

PBNI CommandParm RunApplication cannot obtain

Former Member
0 Kudos

Use RunApplication, found that although the incoming CommandLine but PB end use CommandParm () simply can't get the incoming parameters, how should do? thank you

C++ Code:

WPARAM wParam, LPARAM lParam)

{

                 IPB_Session* session = NULL;

        // Provide command line parameters (employee ids)

        // to be passed to the PowerBuilder application

        LPCTSTR szcommandline = "102 110";

        int wmId, wmEvent, ret;

        PAINTSTRUCT ps;

        HDC hdc;

        HINSTANCE hPBVMInst = ::LoadLibrary("pbvm90.dll");

        P_PB_GetVM getvm = (P_PB_GetVM)

        GetProcAddress(hPBVMInst,"PB_GetVM");

        IPB_VM* vm = NULL;

        getvm(&vm);

        static const char *liblist [] = {"runapp.pbd"};

        vm->RunApplication("runapp", liblist, 1,szcommandline, &session);

        

        session->Release();

        FreeLibrary(hPBVMInst);

        system("PAUSE");

}

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

PowerBuilder Code:

                           MessageBox("command line",CommandParm())

Displayed as an empty string

Former Member
0 Kudos

Did you check the commandline argument in the application open event? It might be that CommandParm() doesn't work under RunApplication.

Former Member
0 Kudos

Yes, I do so, but there is no any value.

How should the szcommandline get?