Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
805 B

  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // MISC.CPP
  4. //
  5. // Microsoft Confidential
  6. // Copyright (c) Microsoft Corporation 1998
  7. // All rights reserved
  8. //
  9. // Contains misc. functions used throughout the program. All these functions
  10. // are externally exported and defined in MISC.H.
  11. //
  12. // 7/98 - Jason Cohen (JCOHEN)
  13. //
  14. //////////////////////////////////////////////////////////////////////////////
  15. // Include files.
  16. //
  17. #include "misc.h"
  18. LPTSTR AllocateString(HINSTANCE hInstance, UINT uID)
  19. {
  20. TCHAR szBuffer[512];
  21. LPTSTR lpBuffer = NULL;
  22. if ( ( LoadString(hInstance, uID, szBuffer, sizeof(szBuffer) / sizeof(TCHAR)) ) &&
  23. ( lpBuffer = (LPTSTR) MALLOC(sizeof(TCHAR) * (lstrlen(szBuffer) + 1)) ) )
  24. lstrcpy(lpBuffer, szBuffer);
  25. return lpBuffer;
  26. }