|
View previous topic :: View next topic
|
| Author |
Message |
Voytovich Oleg
New User

Joined: 13 Nov 2007 Posts: 2 Location: Chelyabinsk, Russia
|
|
|
|
Hi!
I try to write a wrapper around an ISPF VIIF service in C++. But it crashes every time when I use it. This is a my example of using VIIF in C.
| Code: |
extern "OS_UPSTACK" int ISPLINK(char*, ...);
extern "OS_UPSTACK" int viif_read_routine(char **dataptr, unsigned int *lenptr, unsigned int *request, void *dialog_data_ptr)
{
static int j = 0;
char buffer[128];
if (j < 10)
{
memset(buffer, ' ', sizeof(buffer));
sprintf(buffer, "Line %d", j++);
*dataptr = buffer;
return 0;
}
else
{
j = 0;
return 8;
}
}
...
int main(int argc, char* argv[])
{
int rc = 0;
...
unsigned int iRecordLength = 72;
void *read_function_ptr = (void *)&viif_read_routine;
ISPLINK("CONTROL ", "ERRORS ", "RETURN ");
ISPLINK("CONTROL ", "LE ", "ON ");
/* Invoke ISPF View */
rc = ISPLINK("VIIF ",
" ", /* data-name, used for recovery and title */
"VIIFPROF ", /* profile name */
"F ", /* record format */
&iRecordLength, /* record length */
&read_function_ptr, /* read routine pointer */
" ", /* command routine pointer */
" ", /* dialog data */
" ", /* edit length */
" ", /* panel */
" ", /* no macro */
" ", /* format name */
" ", /* sbcs or dbcs */
"NO ", /* recovery is disable */
" ", /* parameters for macro */
" "); /* write routine pointer */
ISPLINK("CONTROL ", "LE ", "OFF ");
ISPLINK("CONTROL ", "ERRORS ", "CANCEL ");
printf("VIIF return %d\n", rc);
...
return rc;
}
|
Do anybody know where I make mistake? |
|
| Back to top |
|
 |
ofer71
Global Moderator

Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
Have you tried to run it with dialog test (3.7 in my main menu) or with ISPVCALL?
O. |
|
| Back to top |
|
 |
Voytovich Oleg
New User

Joined: 13 Nov 2007 Posts: 2 Location: Chelyabinsk, Russia
|
|
|
|
| ofer71 wrote: |
Have you tried to run it with dialog test (3.7 in my main menu) or with ISPVCALL?
O.
|
You cannot use command procedures, like ISPEXEC, to invoke VIIF service. Only ISPLINK allowed. I can't use dialog test to test it.
I suspect that service parameter list or dialog supplied functions format wrong. ISPF Services Guide (for z/OS 1.8) describe VIIF parameters like:
| Quote: |
CALL ISPLINK (’VIIF ’, [data-name], profile-name, rec-format, rec-len, read-routine, [cmd-routine], [dialog-data], [edit-len], [panel-name], [macro-name], [format-name], [’YES ’|’NO ’], [’YES ’|’NO ’], [parm-var] );
|
but this document http://www-1.ibm.com/support/docview.wss?uid=isg1OA20139 deny preceding. In any case, all my attempts to call VIIF service lead to abend.
When I wrote BRIF service wrapper I observed something similar. In that case my dialog supplied function did not conform OS linkage (extern "OS_UPSTACK") and I did not call ISPF Language Environment support for BRIF. |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|