>>In a network scenario, API functions such as GetCurrentDirectory() and GetModuleFilename() return a network drive letter. Is it possible or is there a function(s) to retrieve the server name instead of the drive letter?
>>
>Hi Bill,
>
>I'm not quite sure that this is what you want (and given the problems I seem to be having in typing in the HTML tags, I'm not sure I'll type it the way I want:-)), but try this:
>DECLARE INTEGER WNetGetConnection IN Win32API;
> STRING @lpszLocalName, STRING @lpszRemoteName,;
> INTEGER @lpcchBuffer
>lclocal = "F:"
>lcremote = SPACE(260)
>lnsize = LEN(lcremote)
>* If 0 is returned the call succeeded
>lnerr = WNetGetConnection(@lclocal, @lcremote, @lnsize)
>IF lnerr = 0
> lcremote = LEFT(lcremote, AT(CHR(0), lcbuffer) - 1)
>ENDIF
>hth,
Hi George,
I used this code pretty much as is and am getting a return code of 487. Tried it with several drive letters that I know are active. We're using Novell 4.x under WintNT4.0 Workstation. Am I missing something?
Thanks,
Bill
William A. Caton III
Software Engineer
MAXIMUS
Atlanta, Ga.