Hello All,
I am blocked with some stupid kind of problem. I would like to modify a string that is passed to me by reference, store something in it, and return it to Visual FoxPro, all this from C.
I have created the following function but it does not work :
int test( ParamBlk FAR *Parm )
{
Value val;
TCHAR *Buffer;
TCHAR *StrConst="Hello";
_Load( &Parm->p[0].loc,val );
_SetHandSize( val.ev_handle,sizeof(StrConst));
Buffer = _handToPtr( val.ev_handle );
wsprintf( Buffer,StrConst );
_Store( &Parm->p[0].loc,&val );
_FreeHand( val.ev_handle );
return ( 0 );
}
From VFP I use it the following way :
b = "Nice guy"
? test(@b)
? b && becomes "Hello?uy" (where the Y is in fact a CHR(0))
I would like that b becomes "Hello" with nothing else.
Anyone knows how to deal with it?
Pat