home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / wpstools.lzh / MAKEOBJ.C < prev    next >
C/C++ Source or Header  |  1992-03-14  |  1KB  |  52 lines

  1. /* Makeobj.c -- create WPS object
  2.     usage:
  3.         MAKEOBJ Classname Title Location [setupstring]
  4.     By Ned Konz 3/14/92
  5. */
  6.  
  7. #include <stdio.h>
  8.  
  9. #define INCL_WINWORKPLACE
  10. #include <os2.h>
  11.  
  12. /*
  13. HOBJECT APIENTRY WinCreateObject(PSZ pszClassName,
  14.                                 PSZ pszTitle,
  15.                                 PSZ pszSetupString,
  16.                                 PSZ pszLocation,
  17.                                 ULONG ulFlags );
  18. #define CO_FAILIFEXISTS     1
  19. #define CO_REPLACEIFEXISTS  2
  20. #define CO_UPDATEIFEXISTS   4
  21.  
  22. BOOL APIENTRY WinSetObjectData(HOBJECT hObject,
  23.                                 PSZ pszSetupString);
  24.  
  25. BOOL APIENTRY WinDestroyObject(HOBJECT hObject);
  26.  
  27. HOBJECT APIENTRY WinQueryObject(PSZ pszObjectID);
  28. */
  29.  
  30. int main( int argc, char *argv[] )
  31. {
  32.     HOBJECT hobject;
  33.  
  34.     if (argc < 4) {
  35.         fputs("Usage: ", stderr);
  36.         fputs(argv[0], stderr);
  37.         fputs(" Classname Title Location [setupstring]\n", stderr);
  38.         return 1;
  39.     }
  40.  
  41.     hobject = WinCreateObject((PSZ)argv[1],
  42.                               (PSZ)argv[2],
  43.                               (PSZ)((argc > 4) ? argv[4] : NULL),
  44.                               (PSZ)argv[3],
  45.                               CO_FAILIFEXISTS );
  46.  
  47.     if (! hobject)
  48.         fputs("WinCreateObject failed\n", stderr);
  49.  
  50.     return !hobject;
  51. }
  52.