B
BNP
Hi All,
I have follwoing definitions:
#define MAX_PARAMS 256
typedef struct
{
char funcName[128];
int numParams;
void *params[MAX_PARAMS];
}ML_Command;
int Execute (ML_Command cmd)
{
.....
.....
strcpy (cmd.funName, "SavePortInfo");
cmd.numParams = 5;
cmd.params [0] = (void *)sPortName; //char sPortName[]
cmd.params [1] = (void *)iBdRate; //int iBaudRate
errorCode= ML::Execute (cmd);//this a static function in ML class
return errorCode;
}
The question here is how do I convert sPortName and iBdRate in void*.
Are the cast I have written in code right? If it is wrong, please tell
me where I am making mistake?
Thanks
BNP
I have follwoing definitions:
#define MAX_PARAMS 256
typedef struct
{
char funcName[128];
int numParams;
void *params[MAX_PARAMS];
}ML_Command;
int Execute (ML_Command cmd)
{
.....
.....
strcpy (cmd.funName, "SavePortInfo");
cmd.numParams = 5;
cmd.params [0] = (void *)sPortName; //char sPortName[]
cmd.params [1] = (void *)iBdRate; //int iBaudRate
errorCode= ML::Execute (cmd);//this a static function in ML class
return errorCode;
}
The question here is how do I convert sPortName and iBdRate in void*.
Are the cast I have written in code right? If it is wrong, please tell
me where I am making mistake?
Thanks
BNP