Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Strings with embedded nulls
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00139717
Message ID:
00139748
Vues:
24
>Hi Pat,
>
>You have to set the length of the string, otherwise it would be 0.
>
>val.ev_length = ....;
>
>Christof
>
>
>>Hello All,
>>
>>Is there anybody that can show me how I can return a string with embedded nulls from C to Visual FoxPro?
>>
>>I know that I am supposed to use the _RetVal() function, but I never succeeded returning anything worth it.
>>
>>What's the problem with this code ?
>>
>>int test( ParamBlk *Parm )
>>{
>> TCHAR *Buffer;
>> TCHAR *StrConst="Hello";
>> Value val;
>>
>> val.ev_type = 'C';
>> val.ev_handle = _AllocHand( sizeof(StrConst) );
>> Buffer = _HandToPtr( val.ev_handle );
>> wsprintf( Buffer,StrConst );
>> _RetVal( val );
>> _FreeHand( val.ev_handle );
>>}

Thank you Christof. I expected the _AllocHand() function to set up the length of the string automatically. I don't know why I thought this, because I see no means for the _AllocHand() to do it.

Now it works perfectly. Million thanks again.

Pat
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform