Information générale
Catégorie:
Fonctions Windows API
The others already explained almost everything. :)
Delphi's pChar is a pointer to char, which is exactly C's pointer to char (char* or LPSTR). LPCTSTR is a constant pointer to char (or wide char if on Unicode). VFP doesn't have pointers, so, it doesn't have a direct equivalent.
A pointer is in fact a 32-bit unsigned integer, so wherever you see a LP... (or P...) you can use INTEGER in DECLARE command. The STRING declaration for a string parameter passes in fact a pointer. This is why VFP accepts an integer where a string is expected. But this is useful only (almost) if yoy need to pass a null pointer.
In this particular case, you can declare the first param as INTEGER if you want to be "consistent" with its use.
Vlad
>Thanks, it works. However, is there some book,document or whatever that explains all this. I mean, it looks like you are declaring a function that is going to receive 2 string parameters and then it is called with 1 numeric and 1 string. This is not intuitively obvious. In Delphi, I call the same function with 2 pChar parameters. I didn't think C was this forgiving. Again, Thanks :)
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement