Home > Archive > Clipper > June 2004 > Can I use LanMan with Clipper 5.3 in Win XP ?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Can I use LanMan with Clipper 5.3 in Win XP ?
|
|
| mty_jorg 2004-06-25, 6:50 pm |
| I need help, I'm trying to use LanMan in my application but I recived one
error, I want to Know if this is possible.
I have one application in MS-DOS Clipper 5.3 and I want to print in
network printers with out NET USE.
I have a network with Win 98, Win 2000 and Win XP.
| |
| mty_jorg 2004-06-25, 6:50 pm |
| SORRY, I know the reason of my error, I have clipper 5.2 not 5.3, I try
again and this work wonderfull.
| |
| Mel Smith 2004-06-25, 6:50 pm |
| Klas,
Your LanMan works fine ! Thank you very much for it.
I have one further question however:
How can I determine the 'Share Name' of the default printer on a Windows XP
machine ?
(I know how to get the Computer name thru your 'lm_getcompname()' function)
TIA,
-Mel Smith
| |
| Klas Engwall 2004-06-25, 6:50 pm |
| Mel,
> Your LanMan works fine ! Thank you very much for it.
>
> I have one further question however:
>
> How can I determine the 'Share Name' of the default printer on a Windows XP
>machine ?
>
> (I know how to get the Computer name thru your 'lm_getcompname()' function)
Unfortunately I am not aware of any DOS service that will return that
kind of info. You can enumerate the redirected printers with
LM_GetRedir(), but the default printer isn't necessarily a redirected
one. I might just as well be a local printer that is not shared at all
and thus has no share name.
So this is probably a question for the Win32 api. Perhaps Pritpal has
a solution for you?
Regards,
Klas
-------
klas dot engwall at engwall dot com
Spammers, please use this address :-) mailto:postmaster@[127.0.0.1]
| |
| Mel Smith 2004-06-25, 6:50 pm |
| Klas,
Thanks for the note.
My interest is in simplifying the set-up of my app to use a usb-printer
attached to a WinXP machine.
I hope to relieve (as much as possible) the setup for printing on lpt2:
with the M/S local feedback adapter. Your LanMan package goes 90% of the way
in getting this going. The other 10% is 'sneakily' finding the Shared Printer,
then using your functions to re-direct it as needed, then my own app's print
menu for sending my R&R reports to the appropriate printer (standard or lpt2:).
Many of my users are now starting to get usb-printers. I hate telling them
that they have to buy a 'parallel-port' printer, and furthermore that the
printer must have a 'DOS-capability'.
With your package, I have now printed my R&R reports on my HP5650
usb-printer from my essentially DOS-app with no problem
So, it works great -- except I had hoped that my non-sophisticated users
would not have to 'scratch their heads' about the 'shared' printer name, and I
could find it thru some automated method.
What I'm doing with your package now is (on every report cycle) 'killing'
the re-direction of LPT2, then re-directing again to '\\compname/printername'.
Since I know the shared printer name, this works great for me.
(if only there was a way to gat at the shared printer name -- and assuming
that the default printer *has* a 'shared-name')
Thanks again !
-Mel Smith
| |
| Frank Demont 2004-06-25, 6:50 pm |
| Mel,
I tryed your aproach , so :
1) I have set up LoopBack Adapter as described by markus with succes
From a dos window i can NET USE LPT2 \\....\usb printer , it
works
NET USE shows the usb printer on LPT2
2) Trying with lanman , it fails .
lOk := LM_Redirect(cLPT , cPrinter) // with "LPT2:" and
\\....\usb printer
I got .F.
I have no idea what is wrong
Frank
"Mel Smith" <medsyntel@aol.comnocrud> schreef in bericht
news:20040623110800.13519.00000451@mb-m12.aol.com...
> Klas,
>
> Thanks for the note.
>
> My interest is in simplifying the set-up of my app to use a usb-printer
> attached to a WinXP machine.
>
> I hope to relieve (as much as possible) the setup for printing on
lpt2:
> with the M/S local feedback adapter. Your LanMan package goes 90% of the
way
> in getting this going. The other 10% is 'sneakily' finding the Shared
Printer,
> then using your functions to re-direct it as needed, then my own app's
print
> menu for sending my R&R reports to the appropriate printer (standard or
lpt2:).
>
> Many of my users are now starting to get usb-printers. I hate telling
them
> that they have to buy a 'parallel-port' printer, and furthermore that the
> printer must have a 'DOS-capability'.
>
> With your package, I have now printed my R&R reports on my HP5650
> usb-printer from my essentially DOS-app with no problem
>
> So, it works great -- except I had hoped that my non-sophisticated
users
> would not have to 'scratch their heads' about the 'shared' printer name,
and I
> could find it thru some automated method.
>
> What I'm doing with your package now is (on every report cycle)
'killing'
> the re-direction of LPT2, then re-directing again to
'\\compname/printername'.
> Since I know the shared printer name, this works great for me.
>
> (if only there was a way to gat at the shared printer name -- and
assuming
> that the default printer *has* a 'shared-name')
>
> Thanks again !
>
> -Mel Smith
>
>
| |
| Klas Engwall 2004-06-25, 6:50 pm |
| Frank,
> lOk := LM_Redirect(cLPT , cPrinter) // with "LPT2:" and
>\\....\usb printer
Are you just describing the general idea or do you actually have that
space in the printer name?
Klas
-------
klas dot engwall at engwall dot com
Spammers, please use this address :-) mailto:postmaster@[127.0.0.1]
| |
| Klas Engwall 2004-06-25, 6:50 pm |
| Mel,
> My interest is in simplifying the set-up of my app to use a usb-printer
>attached to a WinXP machine.
>
> I hope to relieve (as much as possible) the setup for printing on lpt2:
>with the M/S local feedback adapter. Your LanMan package goes 90% of the way
>in getting this going. The other 10% is 'sneakily' finding the Shared Printer,
>then using your functions to re-direct it as needed, then my own app's print
>menu for sending my R&R reports to the appropriate printer (standard or lpt2:).
>
> Many of my users are now starting to get usb-printers. I hate telling them
>that they have to buy a 'parallel-port' printer, and furthermore that the
>printer must have a 'DOS-capability'.
As you already know, the first part is already taken care of if the
host OS is Win2K or XP. And the second part can be taken care of with
one of the Windows-compatible printer libraries. Unless I am
completely mistaken Pritpal added that kind of capabilities to his
Vouch32 library recently.
> With your package, I have now printed my R&R reports on my HP5650
>usb-printer from my essentially DOS-app with no problem
>
> So, it works great -- except I had hoped that my non-sophisticated users
>would not have to 'scratch their heads' about the 'shared' printer name, and I
>could find it thru some automated method.
But someone has to set up the sharing, so this someone should be able
to make a note of the share name. Or is that asking too much? <g>
> What I'm doing with your package now is (on every report cycle) 'killing'
>the re-direction of LPT2, then re-directing again to '\\compname/printername'.
>Since I know the shared printer name, this works great for me.
Just watch out for two or more instances of the application running
simultaneously and the one killing the redirection pulling the rug
away from under the feet of the other instances. But if you set up the
redirection immediately before starting the print job and kill it
immediately after finishing, that risk should be minimized.
> (if only there was a way to gat at the shared printer name -- and assuming
>that the default printer *has* a 'shared-name')
As I always say in these situations, investigate what Pritpal can do
for you. About the default printer, to begin with. But also for
finding network resources. There is a Win32 API function called
WNetOpenEnum which together with WNetEnumResource and WNetCloseEnum
are supposed to return approximately the same info as NET VIEW does on
the command line. It will probably require a lot of work, but it could
be worth it.
Klas
-------
klas dot engwall at engwall dot com
Spammers, please use this address :-) mailto:postmaster@[127.0.0.1]
| |
| Mel Smith 2004-06-25, 6:50 pm |
| Klas,
I'll investigate Pritpal's Vounch32 library again (I tried it many months
ago).
Also, the 'icing on the cake' would be for Pritpal to finish creating a Comm
Library (based on Telepathy) that could use modern Windows-only modems. He
said that he'd probably have something ready for Mar 15/2004 -- but I haven't
looked lately.
Thanks again !
-Mel Smith
| |
| Frank Demont 2004-06-25, 6:50 pm |
| Klas,
> Are you just describing the general idea or do you actually have that
> space in the printer name?
Of course it is the idea
The last tests give now .T. on LM_Redirect , i do not know why the first
tests gives .F.
I suppose that mine usb-printer (Lexmark X 1130) supports no DOS. He accepts
the print job ( so he says !!! , he speaks to me !) , but nothing is printed
, while he says that the job is executed.
So this solution will not work for every printer.
I suppose that there is only one good solution : the printer must be
activated from a windows programma , it is what pritbal Bedi does in his
work.
In xharbour , using tprint class from peter reeves , it was not so dificult
to write a program that is able to translate the hp-printer codes from a
text file into commands for the windows printer. Only one litle
inconvenience : swapruncmnd and starting the windows printer gives a delay
(20 a 30 sec).
Frank
"Klas Engwall" <klas.engwall@nospam.please> schreef in bericht
news:40d9fe69.3326232@nntpserver.swip.net...
> Frank,
>
>
> Are you just describing the general idea or do you actually have that
> space in the printer name?
>
> Klas
>
> -------
> klas dot engwall at engwall dot com
>
> Spammers, please use this address :-) mailto:postmaster@[127.0.0.1]
| |
| gabor salai 2004-06-25, 6:50 pm |
| "Mel Smith" <medsyntel@aol.comnocrud> wrote in message
news:20040622122936.04158.00000370@mb-m15.aol.com...
> Klas,
>
> Your LanMan works fine ! Thank you very much for it.
>
> I have one further question however:
>
> How can I determine the 'Share Name' of the default printer on a
Windows XP
> machine ?
>
> (I know how to get the Computer name thru your 'lm_getcompname()'
function)
have you tried prnmgr.vbs script delivered with xp?
besides, there are few prn*.vbs scripts doing all imaginable tasks with
printer management (defaults, sharenames, jobs, ...)
since they are scripts, you may extract any part of them,
modify and use under "run" and redirtect output and later
analyse.
for example, on command prompt on xp try:
cscript \winnt\system32\prnmgr.vbs -l
or:
cscript \winnt\system32\prnmgr.vbs -g
for further info look at xp help search for "script".
built in explanation is realy exhaustive.
| |
| Mel Smith 2004-06-25, 6:50 pm |
| Gabor,
Thank you. I'll look into 'scripting'
-Mel Smith
| |
| gabor salai 2004-06-25, 6:50 pm |
| "Mel Smith" <medsyntel@aol.comnocrud> wrote in message
news:20040624110014.10883.00000257@mb-m25.aol.com...
> Gabor,
>
> Thank you. I'll look into 'scripting'
>
just two typos correction i had noticed [although i hope you had
already solved them]:
1) mentioned vbscript name is not prnmgr.vbs but prnmngr.vbs
[a "n" missing]
2) vbscripts are placed in fact at systemroot, which is in my case
"\winnt", but it may be "\windows" as well, depending on install choice.
| |
| Klas Engwall 2004-06-25, 6:50 pm |
| Frank,
>
>Of course it is the idea
OK. Just checking so I don't give you the wrong medication <g>
>The last tests give now .T. on LM_Redirect , i do not know why the first
>tests gives .F.
Great! So the bottom line is that it _does_ work but sometimes
something is preventing it from doing so. What was the error code you
got from LM_Ferror() when LM_Redirect() failed?
>I suppose that mine usb-printer (Lexmark X 1130) supports no DOS. He accepts
>the print job ( so he says !!! , he speaks to me !) , but nothing is printed
>, while he says that the job is executed.
I searched the web for technical info on the X1130 but found nothing.
Apparently it is discontinued by Lexmark.
>So this solution will not work for every printer.
That really depends on what "this solution" means. You should always
be able to set up a redirection with LM_Redirect() or NET USE provided
that the printer is properly shared and the LPT<n> you want to use is
not already oocupied by another redirection. But whether the
application can talk to the printer once the connection is established
is a completely different question. There are parallell printers that
you can physically connect to the local LPT1 port and still not print
to from Clipper because the printer is too stupid.
Klas
-------
klas dot engwall at engwall dot com
Spammers, please use this address :-) mailto:postmaster@[127.0.0.1]
| |
| Mel Smith 2004-06-25, 6:50 pm |
| Gabor,
Yes, I had already found and made corrections to my own investigations for
prnmngr and for winnt.
Had an intersting time this afternoon implementing those calls to cscript
within my application.
More to come tomorrow in my 'parsing' efforts.
Thanks for the pointers. I'll post a note when I've got it done. I also
note that prncnfg.vbs also allows *setting* the printer share name (I think).
I'll look at that too.
Many thanks to you and to Klas Engwall.
-Mel Smith
|
|
|
|
|