Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How can i get the shared resource path my lpt1 is mapped
Message
From
30/07/2002 09:27:38
 
 
To
30/07/2002 01:00:29
Devrishi Bhogra
Escorts Claas Limited
Faridabad, India
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00683808
Message ID:
00683884
Views:
39
Send the below prg the device e.g. DO getprintername WITH "LPT1:"
*!* Getprintername.prg
PARAMETERS cLocalDevice
DECLARE INTEGER WNetGetConnection IN WIN32API ;
   STRING @ lpLocalName, ;
   STRING @ lpRemoteName, ;
   INTEGER @ lpnLength
IF UPPER(TYPE('cLocalDevice'))="L"
	cLocalDevice = 'LPT1:'
ENDIF
cUNCBuffer = REPL(CHR(0),261)
nLength = LEN(cUNCBuffer)
IF WNetGetConnection(cLocalDevice, @cUNCBuffer, @nLength) = 0
   ? 'The UNC for '+ cLocalDevice + ' is ' + LEFT(cUNCBuffer,AT(CHR(0),cUNCBuffer)-1)
ENDIF
I think I got this from George or Ed...

>Hi !!
>
>When i try to copy any text file on my printer using
>
>API function CopyFile("filename","LPT1:",0)
>it works fine.
>
>But in case, i am using a shared printer, i have to specify the shared printer path (\\servername\sharedprinter)
>
>With the help help of which API function , i can get the the path my lpt: is mapped to ?
>Please Help
>
>Note : also suggest me some good book on using API from visual foxpro.
>
>Regards
>Sunny
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform