🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.sys.acorn.tech
1 messages
1 total messages Started by TMOTA Sat, 19 Dec 1992 05:16
Help with C programming
#709
Author: TMOTA
Date: Sat, 19 Dec 1992 05:16
38 lines
1664 bytes
>>	What the best method of getting hold of a Application's Obey dir'.
>>I'm using Desktop C - so basically I need the path that resspr etc uses
>>to find its resources. At the mo. I'm launching the file with the usual
>>!Run, but with the ugly line...
>>
>>	Run <CADshell$Dir>.!RunImage "<CADshell$Dir>"
>>
>>	Then using argv [1] to pick it up - theres gotta be a better way ;-)

You can use <CADshell$Dir> within your program with no problems,
i.e. to open a file in your directory called 'resource':

  infile = fopen("<CADshell$Dir>.resource", "r");

-this assumes that in your !Run file you are using:
  Set CADshell$Dir <Obey$Dir>

If you want to use the same path as resspr, then use:

  {
    char pathname[256];

    res_findname("resource", pathname);

    fopen(pathname, "r");
  }

If you have done
  res_init("CADshell");
then the above code will fill 'pathname' with the string
  "<CADshell$Dir>.resource"
which can, as above, be used to find your resources.

(cf pages 252-253 of the desktop C manual)
-- 
_________________  "I'd like to answer this question in two ways:
  /____ _ _/_ __       First in my normal voice, and then
 // / //_//_ /_/       in a silly, high-pitched whine." (Monty Python)
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