Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DCOM or COM?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
Divers
Thread ID:
00497236
Message ID:
00497979
Vues:
13
This message has been marked as the solution to the initial question of the thread.
>>>>>George,
>>>>>
>>>>>Thanks! I don't get any errors, but lcRemotename is empty!
>>>>
>>>>Try the following change
lnStatus = WNetGetConnection(@lcDriveLetter, @lcRemoteName, ;
>>>>    @lnRemoteBuffer)
>>>
>>>Yikes! That crashed my computer!
>>
>>Well, here's my code and I use it all the time. Maybe by comparing it with your's you might find the answer.
FUNCTION ConnectName
>>  * This function is part of a class
>>  * That's why the "This.Net_Error" call
>>  * Returns the name of the device
>>  LPARAMETER pc_device
>>
>>  LOCAL lcresult, lcdevice, lcbuffer, lnsize, lnerr
>>  lcresult = ""
>>  lcbuffer = SPACE(200) + CHR(0)
>>  lnsize = LEN(lcbuffer)
>>  lcdevice = pc_device
>>  IF RIGHT(lcdevice, 1) # CHR(0)
>>    lcdevice = lcdevice + CHR(0)
>>  ENDIF
>>  lnerr = WNetGetConnection(@lcdevice, @lcbuffer, @lnsize)
>>  IF lnerr = NO_ERROR
>>    lcresult = LEFT(lcbuffer, AT(CHR(0), lcbuffer) - 1)
>>  ELSE
>>    This.Net_Error()
>>  ENDIF
>>  RETURN lcresult
>>ENDFUNC
>Thanks, George. I'll work on it. At this point I'm thinking its easier to implement the WSH solution! <g>

< s >Well, try the above (adding the necessary declaration and replacing the call to Net_Error with displaying the error number. If that blows up, then the problem isn't with your code.
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