home *** CD-ROM | disk | FTP | other *** search
/ Network Support Encyclopedia 96-1 / novell-nsepro-1996-1-cd2.iso / download / netware / scnfrm.exe / SCANFORM.C next >
C/C++ Source or Header  |  1994-09-29  |  2KB  |  75 lines

  1.  
  2. /****************************************************************************
  3. **        DISCLAIMER
  4. **
  5. **    Novell, Inc. makes no representations or warranties with respect to
  6. **    any NetWare software, and specifically disclaims any express or
  7. **    implied warranties of merchantability, title, or fitness for a
  8. **    particular purpose.
  9. **
  10. **    Distribution of any NetWare software is forbidden without the
  11. **    express written consent of Novell, Inc.  Further, Novell reserves
  12. **    the right to discontinue distribution of any NetWare software.
  13. **
  14. **    Novell is not responsible for lost profits or revenue, loss of use
  15. **    of the software, loss of data, costs of re-creating lost data, the
  16. **    cost of any substitute equipment or program, or claims by any party
  17. **    other than you.  Novell strongly recommends a backup be made before
  18. **    any software is installed.   Technical support for this software
  19. **    may be provided at the discretion of Novell.
  20. ****************************************************************************
  21. #include <stdio.h>
  22. #include <string.h>
  23.  
  24. #include <nwcalls.h>
  25. #include <nwpsrv.h>
  26. #include <nwnet.h>
  27. #include <nwlocale.h>
  28.  
  29. #define MAX_NAME_LEN 100
  30.  
  31. int main (void)
  32. {
  33.     NWCCODE              ccode;
  34.     NWCONN_HANDLE     cHandle;
  35.     DWORD        sequence;
  36.  
  37.     char        serverName[MAX_NAME_LEN];
  38.     char         formName[MAX_NAME_LEN];
  39.     int              flag = 0;
  40.  
  41.     ccode = NWCallsInit (NULL, NULL);
  42.  
  43.     printf ("Server Name:  ");
  44.     gets (serverName);
  45.     strupr (serverName);
  46.  
  47.     ccode = NWGetConnectionIDFromName (strlen (serverName),
  48.         serverName,
  49.         &cHandle);
  50.  
  51.     if (ccode)
  52.     {
  53.         printf ("NWGetConnectionIDFromName returned %X\n", ccode);
  54.         return 1;
  55.     }
  56.  
  57.     sequence = -1;
  58.  
  59.     while ((ccode = NWPSPdfScanForm (NWPS_BINDERY_SERVICE,
  60.         cHandle,
  61.         &sequence,
  62.         formName)) == 0)
  63.     {
  64.         printf ("Form found:  %s\n", formName);
  65.         flag = 1;
  66.     }
  67.  
  68.     if (flag == 0)
  69.     {
  70.         printf ("No forms found\n");
  71.         printf ("NWPSPdfScanForm returned %X\n", ccode);
  72.     }
  73.  
  74.     return 0;
  75. }