59 HINSTANCE hPrevInstance,
64 const char *program_name;
65 CHAR arg_buffer[1024];
71 strcpy(arg_buffer, lpCmdLine);
72 getArguments(&program_name, arg_buffer, &argcount, &arguments);
74 if (program_name == NULL)
77 MessageBox(NULL,
"Syntax: REXXHIDE ProgramName [parameter_1....parameter_n]\n",
"Wrong Arguments", MB_OK | MB_ICONHAND);
96 if ( arguments.
strptr != NULL )
98 rxargs = pgmThrdInst->NewArray(1);
99 pgmThrdInst->ArrayPut(rxargs, pgmThrdInst->NewString(arguments.
strptr, arguments.
strlength), 1);
103 rxargs = pgmThrdInst->NewArray(0);
110 rxcargs = pgmThrdInst->NewArray(argc - 2);
114 rxcargs = pgmThrdInst->NewArray(0);
117 for (i = 2; i < argc; i++)
119 pgmThrdInst->ArrayPut(rxcargs, pgmThrdInst->NewStringFromAsciiz(argv[i]), i - 1);
122 pgmThrdInst->DirectoryPut(dir, rxcargs,
"SYSCARGS");
126 result = pgmThrdInst->CallProgram(program_name, rxargs);
130 rc = (
int32_t)pgmThrdInst->DisplayCondition();
133 sprintf(arg_buffer,
"Open Object Rexx program execution failure: rc = %d",rc);
134 MessageBox(NULL, arg_buffer,
"Execution Error", MB_OK | MB_ICONHAND);
136 pgmInst->Terminate();
141 pgmThrdInst->ObjectToInt32(result, &rc);
144 pgmInst->Terminate();
PCONSTRXSTRING getArguments(const char **program, const char *argptr, size_t *count, PCONSTRXSTRING retarr)
PCHAR * CommandLineToArgvA(PCHAR CmdLine, int32_t *_argc)
RexxReturnCode RexxEntry RexxCreateInterpreter(RexxInstance **instance, RexxThreadContext **context, RexxOption *options)
struct _RexxArrayObject * RexxArrayObject
struct _RexxObjectPtr * RexxObjectPtr
struct _RexxDirectoryObject * RexxDirectoryObject
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)