Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Strings by reference
Message
De
22/09/1998 09:02:28
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Titre:
Strings by reference
Divers
Thread ID:
00139445
Message ID:
00139445
Vues:
68
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform