I am trying to pass a 2 character string to a function. The second character of the string must be either P or R.
When executed, the function returns a value of 9999 which indicates that the second character of the string was not a P or R.
I have tried going about this as many ways as I can find, but I am not very adept when it comes to C++. I am using VS 2005 for this.
Here is the code in question:
Code:
/**
This function converst PS position into Row/Col position
**/
void PStoRC(int pos, int *result) {
int HFunc, HLen, HRc;
char *HBuff = "AP";
// set the variables for the convert to R/C function
HFunc = HA_CONVERT_POS_ROW_COL;
HLen = 0x00;
HRc = pos;
// execute the conversion function
hllapi(&HFunc, HBuff, &HLen, &HRc); // <- This is where the string is passed
// get the results
result[0] = HLen;
result[1] = HRc;
}
What are reasons that the function would not see the P? The first character identifies a session to apply the function to. This character is identified as I can change it to produce other errors such as invalid session ID. Is there something I'm doing wrong?