home *** CD-ROM | disk | FTP | other *** search
/ BUG 4 / BUGCD1997_05.BIN / aplic / clip4win / clip4win.exe / C4W30E.HUF / INCLUDE / OPENFILE.CH < prev    next >
Text File  |  1994-11-08  |  3KB  |  90 lines

  1. ////////////////////////////
  2. //
  3. //    Clip-4-Win OFSTRUCT definitions
  4. //
  5. //    Copyright (C) 1993 Skelton Software, Kendal Cottage, Hillam, Leeds, UK.
  6. //    All Rights Reserved.
  7. //
  8. ////////////////////////////
  9.  
  10. #ifndef    C4W_OFS_CH
  11. #define    C4W_OFS_CH
  12.  
  13.  
  14. // Array elements of aOFS[], which is used with OpenFile()
  15. //
  16. // (these correspond to the members of the Windows OFSTRUCT structure)
  17.  
  18. #define    OFS_cBytes    1    // BYTE
  19. #define    OFS_fFixedDisk    2    // BYTE
  20. #define    OFS_nErrCode    3    // UINT
  21. #define    OFS_reserved    4    // BYTE[4]
  22. #define    OFS_szPathName    5    // char[128]
  23.  
  24. #define    OFS_LENGTH    5    // length of array
  25.  
  26. #define    OFS_A2BIN    "byte,byte,uint,string,string"        // for a2bin()
  27. #define    OFS_BIN2A    "byte,byte,uint,string[4],string[128]"    // for bin2a()
  28.  
  29.  
  30. // OpenFile() flags
  31. #define    OF_READ            0
  32. #define    OF_WRITE        1
  33. #define    OF_READWRITE        2
  34. #define    OF_SHARE_COMPAT        0
  35. #define    OF_SHARE_EXCLUSIVE    16
  36. #define    OF_SHARE_DENY_WRITE    32
  37. #define    OF_SHARE_DENY_READ    48
  38. #define    OF_SHARE_DENY_NONE    64
  39. #define    OF_PARSE        256
  40. #define    OF_DELETE        512
  41. #define    OF_VERIFY        1024
  42. #define    OF_SEARCH        1024
  43. #define    OF_CANCEL        2048
  44. #define    OF_CREATE        4096
  45. #define    OF_PROMPT        8192
  46. #define    OF_EXIST        16384
  47. #define    OF_REOPEN        32768
  48.  
  49. #endif    // C4W_OFS_CH
  50.  
  51.  
  52. ////////////////////////////
  53. //
  54. //    Clip-4-Win DLL / CallDLL() definitions
  55. //
  56. //    Copyright (C) 1994 Skelton Software, Kendal Cottage, Hillam, Leeds, UK.
  57. //    All Rights Reserved.
  58. //
  59. ////////////////////////////
  60.  
  61. #ifndef    C4W_DLL_CH
  62. #define    C4W_DLL_CH
  63.  
  64. #xtranslate _NOREF_    =>
  65. #xtranslate _NOREF_ @    =>
  66.  
  67. #xtranslate _LIB_(<lib>)                        ;
  68.         =>  IIF(<lib> == "USER", "USER.EXE",                ;
  69.                 IIF(<lib> == "GDI", "GDI.EXE",                ;
  70.                     IIF(<lib> == "KERNEL", "KERNEL.EXE", <lib> + ".DLL")))
  71.  
  72. #command _DLL [<static:STATIC>]                        ;
  73.          FUNCTION <name>( [<p1> AS <type1>]                ;
  74.                           [, <pN> AS <typeN>] )                ;
  75.          AS <returnType>                        ;
  76.          [<callType:PASCAL,C>]:<lib>.<entryName>            ;
  77.                                     ;
  78.       => [<static>] FUNCTION <name>( _NOREF_ <p1> [, _NOREF_ <pN>] )    ;
  79.        ; LOCAL _cLib := UPPER( <(lib)> )                ;
  80.        ; LOCAL _hLib := LoadLibrary( _LIB_( _cLib ) )            ;
  81.        ; LOCAL _c := GetProcAddress( _hLib, <(entryName)>, <(callType)>,;
  82.                                      <(returnType)>,            ;
  83.                                      <(type1)> [+"," + <(typeN)>] )    ;
  84.        ; LOCAL _uRet := CallDLL( _c [, <p1>] [, <pN>] )            ;
  85.        ; FreeLibrary( _hLib )                        ;
  86.        ; RETURN _uRet
  87.  
  88.  
  89. #endif    // C4W_DLL_CH
  90.