#gfx_Get_Path question
5 messages in this thread
I have a question about the gfx_get_path function from the IPAS3 toolkit. I am
trying to get the 3ds root path. The reference list the params for
gfx_get_paths as follows
int,int,char*,char*
but when I fill out the params I get an error message on compile. Here is the
code and error message.
>>int i;
>>char LineData[80],mode[10],temp[90],tm[13];
>>gfx_get_paths(GFX_3DS_PATH,i,temp,tm);
>>Error! E1031: Name 'tm' not found in struct/union
Any suggestion on why I get this error. BTW I am using the Watcom 9.5
compiler.
Thanks
Peter Watje
Spectral Imaging
HI Peter,
<< IPAS3 >>
As an owner of IPAS3, you're entitled to a free upgrade to IPAS4. The GFX_path
calls were extended to also provide the home_path, process_path, vp_path,
prj_path, driver_path, temp_path, fli_path and the preview_path. Please call
Customer Service at 1-800-538-6401.
<< Error!.. >>
hm…The following should work for you.
void v3_get_paths(int type,int num,char *path,char *file)
{
/* Path offsets for 3DS 3.0 */
static int poffset[] = {
0x19d1a0, /* HOME */
0x6d00, /* PROCESS */
0x1f2f8, /* VP */
0x40d6, /* PRJ */
0x6cbc, /* DRIVER */
0x3f8c, /* TEMP */
0x419c, /* FLI */
0x415a /* PREVIEW */
};
/* Filename offsets for 3DS 3.0 (0 indicates no appropriate filename) */
static int foffset[] = {
0, /* HOME */
0, /* PROCESS */
0x1f33c, /* VP */
0x426e, /* PRJ */
0, /* DRIVER */
0, /* TEMP */
0x4288, /* FLI */
0 /* PREVIEW */
};
char _far *p;
int index=type-GFX_HOME_PATH;
if(index<0)
{
gfx_get_paths(type,num,path,file);
}
else
{
/* Copy path string from 3DS */
((struct overlay *)&p)->seg=((REGS _far *)GI->regs)->ds;
((struct overlay *)&p)->offset=poffset[index];
fnstrcpy(path,p);
/* Copy filename string from 3DS (if appropriate) */
if(foffset[index]!=0)
{
((struct overlay *)&p)->seg=((REGS _far *)GI->regs)->ds;
((struct overlay *)&p)->offset=foffset[index];
fnstrcpy(file,p);
}
else
strcpy(file,"");
}
}
Let me know if this helped.
jonas[adesk]
Hi Peter,
Check the gfx_get_path macro in the exprtn.h file and check to see that the
macro looks like this:
#define gfx_get_paths(type,num,p,f) \
{GC->opcode=GFX_GET_PATHS; GC->params[0]=type; GC->params[1]=num; \
do_GFX(); fnstrcpy(p,GC->s1.fs.path); fnstrcpy(f,GC->s1.fs.file); }
I'm not quite sure how you could get the error messsage, but you could get an
error message like that if the "f" parameter on the macro became "fs" (thereby
replacing the "fs" field name with "tm", hence the error. Maybe it would be a
good idea to edit the two occurances of "f" (not "fs") and change them to
something like "j", then there could be no confusion possible.
-Grant Blaha [ADESK]
Grant,
The macro for the gfx_get_paths looked like this:
#define gfx_get_paths(type,num,p,file)
I changed the param file (and all the refereces) to f and presto the problem
went away.
Thanks for the help. Really appreciate the quick response.
Peter Watje
Spectral Imaging
.
>> I changed the param file (and all the refereces) to f and presto the
problem went away. <<
Oh! That old bug. You should really follow Jonas's advice and get the update
to the toolkit.
-Grant Blaha [ADESK]