Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Strings by reference
Message
From
22/09/1998 09:02:28
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
Strings by reference
Miscellaneous
Thread ID:
00139445
Message ID:
00139445
Views:
69
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
Next
Reply
Map
View

Click here to load this message in the networking platform