× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



How are you defining and initializing the error code parameter? If all
you're doing, to get the program to crash, is passing in a non-zero value
then I suspect the API is overwriting your program storage while returning
error related information -- meaning that BytesProvided does not reflect
your actual allocation of the structure.

Bruce

On Tue, Nov 1, 2011 at 5:59 PM, Ryan Downing <rdowning@xxxxxxxxxxxxxxxx>wrote:

Hey folks,

I'm a little new to this iSeries thing, and I have a problem I was
hoping someone could help me with...

I'm opening a virtual terminal session to an iSeries using the IBM API
QTVOPNVT in a C++ program using all three of the optional parameter
groups.

The current issue under test is what happens if the data queue
mentioned in the function call (6th parm) is missing. The program
works correctly in other circumstances with both exception handling
and error struct passing.

Using the pragma style exception handling, it correctly returns a
CPF9801 in the caught error. Passing in a Qus_EC struct with
Bytes_Provided set to a non-zero value crashes the program. Looking
in the IBM documentation for the API call, CPF9801 (or, for that
matter, any sort of "data queue not found" type error) doesn't appear
in the expected errors list, so I'm thinking it might not be able to
handle this eventuality.

My shop has strong feelings towards using only return value error
handling, so I'd prefer not to use the exception method, but the only
way I can think of to get around it right now is to first do another
API call to test existence of the data queue and I'd like to avoid the
performance hit.

Does anyone know if there's a way to get the best of both worlds?
Maybe I'm doing something wrong on the call...? Even confirmation
that I can't get a return of this value would be great.

Definition of API:


#pragma map(OpenVT,"QTVOPNVT")
extern "OS" void OpenVT(
char *,
char *,
int,
int,
int,
char *, /* Passing in a Queue here
which does not exist */
char *,
int,
void *,
char *,
char *,
char *,
int);


Cheers,
Ryan
--
This is the C programming iSeries / AS400 (C400-L) mailing list
To post a message email: C400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/c400-l
or email: C400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/c400-l.





As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.