🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.nativeapi
5 messages
5 total messages Started by Denville Longhurst Fri, 07 Mar 2003 15:52
Named Pipe from DOS app
#17634
Author: Denville Longhurst
Date: Fri, 07 Mar 2003 15:52
26 lines
1905 bytes
Has anyone managed to set up a named pipe from a DOS app (client) running in
a DOS box to a Win32 app (OS is XP Pro)?  I can get the DOS app to open the
pipe (because it returns from ConnectNamedPipe() at the server) but it
immediately fails with an access denied error.  I have tried to open up the
server pipe to anyone:

SECURITY_ATTRIBUTES SecurityAttributes ;
SECURITY_DESCRIPTOR SecurityDescriptor ;

    InitializeSecurityDescriptor( &SecurityDescriptor,
SECURITY_DESCRIPTOR_REVISION ) ;
    SetSecurityDescriptorDacl( &SecurityDescriptor, TRUE, NULL, FALSE ) ;
    SecurityAttributes.nLength = sizeof(SECURITY_ATTRIBUTES) ;
    SecurityAttributes.bInheritHandle = FALSE ;
    SecurityAttributes.lpSecurityDescriptor = &SecurityDescriptor ;

     hPipe = CreateNamedPipe( cName, PIPE_ACCESS_INBOUND,
        PIPE_TYPE_BYTE | PIPE_WAIT, 1, 0, 0, nInbufSize,
&SecurityAttributes ) ;

Is there anything more I can do, or is it a non-starter?

Many thanks,

Denville
Leeds, England.
Re: Named Pipe from DOS app
#17653
Author: Early Ehlinger
Date: Sat, 08 Mar 2003 18:09
19 lines
1742 bytes
Do you really mean DOS, as in MS-DOS, the 16-bit operating system that is
now defunct?

Or do you mean a Win32 console-mode program?

If the latter, using a named pipe is exactly the same in console mode as it
is in windows mode.  In fact, everything is the same in console mode as it
is in windows mode, except that Windows has created a console for you before
launching your program.  You can even create pop-up windows without any
problem from a console.


--
-- Early Ehlinger CEO, ResPower Inc - Toll-Free : 866-737-7697 --
- RenderFarm - Lightwave , 3dSMax , Bryce , Maya , AfterEffects -
--- www.respower.com -- 500+ GHz Starting At USD$0.50/GHz*Hour --
----------------- SuperComputing For the Masses! ----------------
"I'm so busy programming my computer to let me be lazy, I never
get any rest!" - John Kaster
Re: Named Pipe from DOS app
#17654
Author: Denville Longhurst
Date: Sat, 08 Mar 2003 19:04
54 lines
3238 bytes
I really do mean DOS.  The problem is I have a legacy app to maintain.  I
run it in a dos box and it works fine, producing printed output.  I have
been asked to modify it so that the output can be distributed
electronically.  I have investigated several pseudo-printers which take
print output from an app and convert it to electronic form (eg the Acrobat
'printer') but my legacy app only produces character output to a port (I use
LPT3 and assign that to a Windows printer, which allows it to print fine).

I really can't convert it to a Windows app; it is written in Clipper and it
would take a disproportionate time to convert it.  I can make modifications
to it and re-compile the app.  I know that Clipper send to the printer as a
device, so I can re-compile with a pipe address instead of LPT3 (then use a
simple windows app to collect the character text and distribute it by
e-mail).  This almost works, but I have come up against the access denied
security issue I posted.  It is particularly frustrating, I was prepared for
it not to work at all, but to 'almost' work is cruel !


The only other alternative I can think of is to save the output as a file,
then run a second app to import and post it.  I think this would work, but
not as 'smoothly'.

Many thanks for the reply,

Denville.

"Early Ehlinger" <early@respower.com> wrote in message
news:3e6a3208@newsgroups.borland.com...
> Do you really mean DOS, as in MS-DOS, the 16-bit operating system that is
> now defunct?
>
> Or do you mean a Win32 console-mode program?
>
> If the latter, using a named pipe is exactly the same in console mode as
it
> is in windows mode.  In fact, everything is the same in console mode as it
> is in windows mode, except that Windows has created a console for you
before
> launching your program.  You can even create pop-up windows without any
> problem from a console.
>
>
> --
> -- Early Ehlinger CEO, ResPower Inc - Toll-Free : 866-737-7697 --
> - RenderFarm - Lightwave , 3dSMax , Bryce , Maya , AfterEffects -
> --- www.respower.com -- 500+ GHz Starting At USD$0.50/GHz*Hour --
> ----------------- SuperComputing For the Masses! ----------------
> "I'm so busy programming my computer to let me be lazy, I never
> get any rest!" - John Kaster
>
>
>
>
>
Re: Named Pipe from DOS app
#17656
Author: Early Ehlinger
Date: Sat, 08 Mar 2003 20:27
22 lines
2115 bytes
"Denville Longhurst" <Denville@metco.co.uk> wrote:
> The only other alternative I can think of is to save the output as a file,
> then run a second app to import and post it.  I think this would work, but
> not as 'smoothly'.

Actually, this is exactly the approach I would take.  If your app is
basically sending pre-formatted text to the printer, i.e., just
alphanumerics, characters, newlines but no tabs or escape sequences, then
why not have it dump the same info to a text file that can then be
distributed electronically?

The posting app could even be implemented as a service/hidden application
that monitors a special folder for changes, detects the presence of the
file, and posts it when it appears.

--
-- Early Ehlinger CEO, ResPower Inc - Toll-Free : 866-737-7697 --
- RenderFarm - Lightwave , 3dSMax , Bryce , Maya , AfterEffects -
--- www.respower.com -- 500+ GHz Starting At USD$0.50/GHz*Hour --
----------------- SuperComputing For the Masses! ----------------
"I'm so busy programming my computer to let me be lazy, I never
get any rest!" - John Kaster
Re: Named Pipe from DOS app
#17657
Author: Denville Longhurst
Date: Sat, 08 Mar 2003 21:01
36 lines
2385 bytes
Thanks, Early, that settles it.  I hadn't thought of the latter possibility,
but it's a really good idea.

Regards,
Denville.

"Early Ehlinger" <early@respower.com> wrote in message
news:3e6a5248@newsgroups.borland.com...
> "Denville Longhurst" <Denville@metco.co.uk> wrote:
> > The only other alternative I can think of is to save the output as a
file,
> > then run a second app to import and post it.  I think this would work,
but
> > not as 'smoothly'.
>
> Actually, this is exactly the approach I would take.  If your app is
> basically sending pre-formatted text to the printer, i.e., just
> alphanumerics, characters, newlines but no tabs or escape sequences, then
> why not have it dump the same info to a text file that can then be
> distributed electronically?
>
> The posting app could even be implemented as a service/hidden application
> that monitors a special folder for changes, detects the presence of the
> file, and posts it when it appears.
>
> --
> -- Early Ehlinger CEO, ResPower Inc - Toll-Free : 866-737-7697 --
> - RenderFarm - Lightwave , 3dSMax , Bryce , Maya , AfterEffects -
> --- www.respower.com -- 500+ GHz Starting At USD$0.50/GHz*Hour --
> ----------------- SuperComputing For the Masses! ----------------
> "I'm so busy programming my computer to let me be lazy, I never
> get any rest!" - John Kaster
>
>
>
>
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads