home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / BC_502 / BOCOLE.PAK / UTILS.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1997-05-06  |  1.2 KB  |  62 lines

  1. //----------------------------------------------------------------------------
  2. // ObjectComponents
  3. // Copyright (c) 1991, 1996 by Borland International, All Rights Reserved
  4. //
  5. // $Revision:   2.4  $
  6. //
  7. // Contains some functions to make 32-bit bocole work under WIN95.
  8. //----------------------------------------------------------------------------
  9. #ifdef WIN32
  10. #ifndef UNICODE
  11.  
  12. #include "BOle.h"
  13. #include "Utils.h"
  14.  
  15. LPWSTR lstrcpyW2(LPWSTR lpString1, LPCWSTR lpString2)
  16. {
  17.   while (*lpString1++ = *lpString2++)
  18.   ;
  19.  
  20.   return lpString1;
  21. }
  22.  
  23. LPWSTR lstrcpynW2(LPWSTR lpString1, LPCWSTR lpString2, int count)
  24. {
  25.   for (int i = 0; i < count; i++)
  26.     *(lpString1+i) = *(lpString2+i);
  27.  
  28.   return lpString1;
  29. }
  30.  
  31. LPWSTR lstrcatW2(LPWSTR lpString1, LPCWSTR lpString2)
  32. {
  33.   lstrcpyW2(lpString1+lstrlenW2(lpString1), lpString2);
  34.  
  35.   return lpString1;
  36. }
  37.  
  38. int lstrlenW2(LPCWSTR lpString)
  39. {
  40.   int count = 0;
  41.  
  42.   while (*lpString++)
  43.     count++;
  44.  
  45.   return count;
  46. }
  47.  
  48. int lstrcmpW2 (LPWSTR lpString1, LPCWSTR lpString2)
  49. {
  50.   while (*lpString1++) {
  51.     if (*lpString1 != *lpString2)
  52.       return -1;
  53.   }
  54.   if (*lpString2 != '\0')
  55.     return -1;
  56.   return 0;
  57. }
  58.  
  59. #endif
  60. #endif
  61.  
  62.