home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / winui / input / ime / imeapps / wsubs.c < prev   
Encoding:
C/C++ Source or Header  |  1997-09-11  |  869 b   |  59 lines

  1. #include "windows.h"
  2.  
  3. #ifdef USEWAPI
  4. int PASCAL MylstrcmpW(LPWSTR lp0, LPWSTR lp1)
  5. {
  6.  
  7.     while(*lp0)
  8.     {
  9.         if (*lp0 != *lp1)
  10.         {
  11.             return (-1);
  12.         }
  13.         lp0++;
  14.         lp1++;
  15.  
  16.     }
  17.     if (!*lp1)
  18.         return 0;
  19.  
  20.     return 1;
  21. }
  22. int PASCAL MylstrcpyW(LPWSTR lp0, LPWSTR lp1)
  23. {
  24.     int n = 0;
  25.  
  26.     while(*lp1)
  27.     {
  28.         *lp0 = *lp1;
  29.         lp0++;
  30.         lp1++;
  31.         n++;
  32.     }
  33.     *lp0 = *lp1;
  34.     return n;
  35. }
  36. int PASCAL MylstrcatW(LPWSTR lp0, LPWSTR lp1)
  37. {
  38.     int n = 0;
  39.  
  40.     while(*lp0)
  41.         lp0++;
  42.  
  43.     return MylstrcpyW(lp0, lp1);
  44. }
  45. LPWSTR PASCAL MyCharPrevW(LPWSTR lpStart, LPWSTR lpCur)
  46. {
  47.     LPWSTR lpRet = lpStart;
  48.     if (lpCur > lpStart)
  49.         lpRet = lpCur - 1;
  50.  
  51.     return lpRet;
  52. }
  53. LPWSTR PASCAL MyCharNextW(LPWSTR lp)
  54. {
  55.     return lp++;
  56. }
  57. #endif
  58.  
  59.