Article View: comp.sys.amiga.tech
Article #2873Re: Manx Startup Code
From: Doug Merritt
Date: Sun, 21 Jan 1990 16:45
Date: Sun, 21 Jan 1990 16:45
27 lines
1620 bytes
1620 bytes
In article <1990Jan19.161350.9943@csmil.umich.edu> brode@csmil.umich.edu (Jon Brode) writes:
>-----------------
>Does anyone know how to work with Manx's startup code for programs to
>run from the workbench? Specifically, does WBStartup get passed to argv
>even if you just use main(argv,argc).
See the source supplied with your compiler, src/_main.c. The answer
is "not exactly". In this case, argc == 0 (whereas in a CLI environment
it'll always be >= 1), and you look through "extern struct WBStartup
*WBenchMsg" to find any workbench arguments (locks on shift-clicked icons,
etc).
Pretty straightforward. Just remember to be careful of doing i/o like
printf() without a window (fireworks mode).
In order to get stdio functions like printf to write to the window you
opened as opposed to causing fireworks, I think you have to do:
handle = Open("CON:0/0/200/320/MyName", MODE_NEWFILE);
_devtab[0] = handle; /* reset stdin */
_devtab[1] = handle; /* reset stdout */
_devtab[2] = handle; /* reset stderr */
Or something like that. Again see _main.c.
Doug
--
Doug Merritt {pyramid,apple}!xdos!doug
Member, Crusaders for a Better Tomorrow Professional Wildeyed Visionary
Technical Details
Message-ID:
<625@xdos.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!usc!apple!motcsd!xdos!dougReferences:
<1990Jan19.161350.9943@csmil.umich.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!usc!apple!motcsd!xdos!doug From: doug@xdos.UUCP (Doug Merritt) Newsgroups: comp.sys.amiga.tech Subject: Re: Manx Startup Code Message-ID: <625@xdos.UUCP> Date: 21 Jan 90 16:45:21 GMT References: <1990Jan19.161350.9943@csmil.umich.edu> Reply-To: doug@xdos.UUCP (Doug Merritt) Organization: Hunter Systems, Mountain View CA (Silicon Valley) Lines: 27