home *** CD-ROM | disk | FTP | other *** search
/ Mac Power 1997 January / macpower199701.bin / AMUG / Programming_10 / Videotoolbox 96-08-22-c.sit / VideoToolbox / (Utilities) / GrabDrivers / AddResourceToFile.c next >
Encoding:
C/C++ Source or Header  |  1995-07-26  |  1.6 KB  |  4 lines  |  [TEXT/CWIE]

  1. □□AddResourceToFile.c□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□TEXTCWIE□□□□□□□□□□□□□é□□□址;ョォャ;ョォ□□□□□□□□□□□□□□□□□□□□□□□=ùヨ□#include "VideoToolbox.h"
  2. //#include <Errors.h>
  3. //#include <Files.h>
  4. //#include <Resources.h>
  5. void AddResourceToFile(unsigned char *filename,unsigned char *name,ResType type,int id,Handle handle);
  6.  
  7. void AddResourceToFile(unsigned char *filename,unsigned char *name,ResType type,int id,Handle handle)
  8. {
  9.     short RefNo;
  10.     int i;
  11.     FInfo outFileInfo;
  12.  
  13.     if(handle==NULL)return;
  14.     CreateResFile(filename);
  15.     GetFInfo(filename,0,&outFileInfo);
  16.     outFileInfo.fdType = 'rsrc';    // resource
  17.     outFileInfo.fdCreator = 'RSED';    // ResEdit
  18.     SetFInfo(filename,0,&outFileInfo);
  19.     RefNo = OpenResFile(filename);
  20.     if(RefNo == -1)PrintfExit("Can't create file!¥007¥n");
  21.     AddResource(handle,type,id,name);
  22.     i=ResError();
  23.     if(i != 0) printf("AddResource error %d¥007, ",i);
  24.     if(i == resNotFound) printf("resource not found.¥n");
  25.     if(i == resFNotFound) printf("resource file not found.¥n");
  26.     if(i == addResFailed) printf("add resource failed.¥n");
  27.     if(i == rmvResFailed) printf("remove resource failed.¥n");
  28.     CloseResFile(RefNo);
  29. }
  30. □□□□□□□□□□□□□□□□□□□□□□□□□□□□□□T□□T□□F□□□’    TimeVideo□□□APPLTiVi!□□□@□AddResourceToFile.c□□□TEXTCWIE□TEXTCWIE□□□□□□□□□□□□□□□□□□□□□□□ァm
  31. ウ□□□é□□□š□□□□□□□□□□□’□TimeVideo results0r□□□TEXTttxt□□□□□\□□□aŽ□□□)p□L□□□□□□|□&ェ^:ðェ^;^□□□□□□□□□□□□□□□□□□□’□ュ □□□□□□□□□ュŸ□□□□□□□□□□□□H⇥Monaco□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□V␤□ワ□\V␤□ワ□\ャ;vハ□□&□□.□□□□□□□□□□□□□□□□□□□□□T□□T□□F□‰/è□ミ□□□□F□□MPSR□□□□MWBB□□□□□í……□□□□□□□□□ð……□□L□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□□