Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
NOVELL
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Re: NOVELL
Divers
Thread ID:
00117137
Message ID:
00117850
Vues:
27
>>-Snip-
>>
>>Sorry, for the snip there, Ed, but I had a hard time reading the message in the browser and had to paste it into the Notepad. I think all the HTML tags were messing up the word wrapping.
>>
>>After reading your response, I'm not sure what you're saying. The C declaration (to me) says pass the parameters by reference (LPSTR is a pointer to a string, for example, so it must be passed by reference). My usage of the WNetGetConnection() function uses the same declaration and passes all by reference including the drive. It works fine.
>>
>
>Try passing lpRemoteName (the first parameter) by VALUE, e.g. the string expression "Z:" rather than assigning "Z:" to a charVar and passing the charVar by reference. It still works. And if by ref and by val altered from passing address of the var to passing the value itself, it shouldn't.
>
I have no idea about the what's going on internally here. Yes, it does work, but it won't if you don't pass the buffer length by reference (even if it's declared by value. Further, passing the drive letter by reference doesn't alter it.

>>I think that the confusion may be caused by the LPCSTR and LPSTR types. Here's what the Win32.hlp file says:
>>LPCSTR: Pointer to a constant null-terminated Windows character string.
>>
>>LPSTR: Pointer to a null-terminated Windows character string.
>>
>>Since both are pointers, they should be passed by reference. Whether or not VFP actually passes any string by value to a DLL call, I don't know.
>
>It would have to, otherwise, all those nice structures we plotzed into a string wouldn't work right where we pass the structure by value rather than by reference in the DLL call..

Well, structures are always passed by pointers anyway, so we declare and pass the strings by reference.
>
>>
>>As an aside, I don't believe that it's necessary to add the CHR(0) to any string. I've never done it, and never experienced a problem. I get the feeling (and that's all that this is) that VFP does that for you.
>
>I've been bitten specifically when passing a non-null password into WNetAddConnection() without a null terminator.

Thanks for that tip. I've always used it with a server that's already been mapped to, so I just pass 0 for the string. The API accepts that as a NULL pointer.
>
>This is getting a bit wierd, even for the Fearr and Loathing crowd...
>
Watch it, Gozo John will be after you.:-)
George

Ubi caritas et amor, deus ibi est
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform