Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / CodeWarrior / January 2005



Tip: Looking for answers? Try searching our database.

Choosing a file with Navigatition Services

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Conrado Pla - 27 Jan 2005 16:04 GMT
I have a problem which I don't understand:

I am using codeWarrior 9.3.

I am trying to select and open files of type PICT, regardless of the creator,
so, according to the documentation I use

 
err=NavCreateCooseFileDialog(&NavOptions,fileTypeListH,NULL,NULL,NULL,NULL,&outDi
alog);

The Nav options are basically the standard options.

The fileType list contains only 1 item for the PICT, and the generic component
signature:
 
  (*fileTypeListH)->osTypeCount=1;
  (*fileTypeListH)->componentSignature=kNavGenericSignature;
  (*fileTypeListH)->osType='PICT'

What happens is that only PICT files with the component signature equal to the
creator tag of the application are selected.  Other PICT files are dimmed and
cannot be selected, in particular PICT files of type 'ttxt' created by grabbing
a frame from an iMovie sequence.  I can verify with ResEdit that these fiels are
really of type 'PICT' and creator 'ttxt' but the Nav window will not make them
selectable.  I tried with NavCreateGetFileDialog and I get exactly the same
reults.

Why the
 
  (*fileTypeListH)->componentSignature=kNavGenericSignature;

doesn't seem to have an effect?

FURTHERMORE, if I opt for selecting ALL files, passing the list handle as NULL,
the when I select a PICT file with creator 'ttxt' (craeted with iMovie), after
doing

        err=AECountItems(&navReply->selection,&n);
        err = AEGetNthPtr(&navReply->selection, n,
                                   typeFSRef, &theKeyword,
                                   actualType,&fsref,   //fspec,
                                   sizeof(fsref),
                                   &actualSize);
       
                               
err=FSGetCatalogInfo(&fsref,kFSCatInfoGettableInfo,&cinfo,&uname,fspec,NULL);
         
err=FSGetCatalogInfo(&fsref,kFSCatInfoFinderInfo,&cinfo,&uname,fspec,NULL);

     err=FSpGetFInfo(fspec,&finfo);
 

I get a finfo.fdtype=0, not ='PICT' as it should be expected.

What am I doing wrong or not taking into consideration?

It works for any other combination of Type and Creator which I use.

Thanks

Conrado Pla
larry@skytag.com - 28 Jan 2005 09:28 GMT
> I have a problem which I don't understand:
>
> I am using codeWarrior 9.3.
>
> I am trying to select and open files of type PICT, regardless of the creator,
> so, according to the documentation I use

err=NavCreateCooseFileDialog(&NavOptions,fileTypeListH,NULL,NULL,NULL,NULL,&outDi
> alog);
>
[quoted text clipped - 6 lines]
>    (*fileTypeListH)->componentSignature=kNavGenericSignature;
>    (*fileTypeListH)->osType='PICT'

This should be (*fileTypeListH)->osType[0]='PICT';

> What happens is that only PICT files with the component signature equal to the
> creator tag of the application are selected.

I just tried this (with the above correction) in 10.3.7 and it worked
as advertised. The only other difference in my code is that I set the
"reserved" field to 0.

> Other PICT files are dimmed and
> cannot be selected, in particular PICT files of type 'ttxt' created by grabbing
[quoted text clipped - 19 lines]
>                                     sizeof(fsref),
>                                     &actualSize);

err=FSGetCatalogInfo(&fsref,kFSCatInfoGettableInfo,&cinfo,&uname,fspec,NULL);

err=FSGetCatalogInfo(&fsref,kFSCatInfoFinderInfo,&cinfo,&uname,fspec,NULL);

>       err=FSpGetFInfo(fspec,&finfo);

Why do you use this? You can get the file's type from cinfo:

( (FileInfo*)cinfo.finderInfo )->fileType;

> I get a finfo.fdtype=0, not ='PICT' as it should be expected.

I seem to recall vaguely that FSpGetFInfo() might have bug in it. But
you don't need it anyway.

Larry
Conrado Pla - 28 Jan 2005 10:29 GMT
> > I have a problem which I don't understand:
> >
[quoted text clipped - 3 lines]
> creator,
> > so, according to the documentation I use

Thanks for your help Larry:

I tried with the modifications you suggest but the same thing happens: PICT
files produced by iMovie (creator "ttxt") are dimmed and unselectable.  If I set
Navigator to show all files (passing fileTypeListH =NULL) and then select one of
these,it gives me always file type=0.

I tried something: I took one of those PICT files from iMovie, read it with
Photoshop and resaved it as a PICT file (with a different name).  When I went
again with the debugger following step by step, this file was hilited and the
file type was OK, 'PICT'.

I don't understand what is so special about the iMovie files, with creator 'ttxt'

I did something else: with ResEdit I changed the creator on one of those files
to 'abcd' (arbitrary as you can see) and then it works fine, so positively has
to do with the 'ttxt' file type.

If you have any other suggestion, let me know please.
Thanks

Conrado

> err=NavCreateCooseFileDialog(&NavOptions,fileTypeListH,NULL,NULL,NULL,NULL,&ou
> tDi
[quoted text clipped - 66 lines]
>
> Larry
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.