Leaked source code of windows server 2003
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.

57 lines
1007 B

  1. /*++ BUILD Version: 0000 // Increment this if a change has global effects
  2. Copyright (c) 2000-2002 Microsoft Corporation
  3. Module Name:
  4. ids.cpp
  5. Abstract:
  6. Source file module for string resource manipulation
  7. Author:
  8. Elena Apreutesei (elenaap) 30-October-2000
  9. Revision History:
  10. --*/
  11. #include "windows.h"
  12. #include "util.h"
  13. HMODULE CIds::m_hModule = NULL;
  14. void CIds::GetModuleHnd (void)
  15. {
  16. if (!m_hModule)
  17. {
  18. m_hModule = GetModuleHandle(NULL);
  19. }
  20. }
  21. void CIds::LoadIds (UINT resourceID)
  22. {
  23. TCHAR szBuffer[ MAX_IDS_BUFFER_SIZE ];
  24. if (m_hModule != NULL &&
  25. LoadString (
  26. m_hModule,
  27. resourceID,
  28. szBuffer,
  29. MAX_IDS_BUFFER_SIZE - 1 ) > 0)
  30. {
  31. m_szString = new TCHAR [ _tcslen( szBuffer ) + 1 ];
  32. if ( m_szString )
  33. {
  34. _tcscpy( m_szString, szBuffer );
  35. }
  36. }
  37. else
  38. {
  39. m_szString = NULL;
  40. }
  41. }