Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DCOM or COM?
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Miscellaneous
Thread ID:
00497236
Message ID:
00497958
Views:
11
>>>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
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform