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.

97 lines
2.7 KiB

  1. /*++
  2. Microsoft Windows
  3. Copyright (C) Microsoft Corporation, 1981 - 1999
  4. Module Name:
  5. utils.h
  6. Abstract:
  7. Author:
  8. Rahul Thombre (RahulTh) 4/30/1998
  9. Revision History:
  10. 4/30/1998 RahulTh
  11. Created this module.
  12. 10/12/1998 RahulTh
  13. added better error handling capabilities : CError etc.
  14. --*/
  15. #ifndef __UTILS_H__
  16. #define __UTILS_H__
  17. class CError
  18. {
  19. public:
  20. //constructor
  21. CError (CWnd* pParentWnd = NULL,
  22. UINT titleID = IDS_DEFAULT_ERROR_TITLE,
  23. DWORD dwWinErr = ERROR_SUCCESS,
  24. UINT nStyle = MB_OK | MB_ICONEXCLAMATION)
  25. : m_hWndParent(pParentWnd?pParentWnd->m_hWnd:NULL),
  26. m_msgID (IDS_DEFAULT_ERROR),
  27. m_titleID (titleID),
  28. m_winErr (dwWinErr),
  29. m_nStyle (nStyle)
  30. {}
  31. int ShowMessage(UINT errID, ...);
  32. private:
  33. //data members
  34. HWND m_hWndParent; //handle to the parent window
  35. UINT m_msgID; //resource id of the error message
  36. UINT m_titleID;//resource id of the title of the error message
  37. DWORD m_winErr; //win32 error code if any
  38. UINT m_nStyle; //the message box style to be displayed
  39. //helper functions
  40. void CError::ConstructMessage (va_list argList, CString& szErrMsg);
  41. };
  42. struct SEND_FAILURE_DATA
  43. {
  44. TCHAR FileName[MAX_PATH];
  45. FAILURE_LOCATION Location;
  46. error_status_t Error;
  47. };
  48. int ParseFileNames (TCHAR* pszInString, TCHAR* pszFilesList, int& iCharCount);
  49. DWORD GetIRRegVal (LPCTSTR szValName, DWORD dwDefVal);
  50. TCHAR* GetFullPathnames (TCHAR* pszPath, //directory in which the files are located
  51. const TCHAR* pszFilesList, //NULL separated list of filenames
  52. int iFileCount, //number of files in pszFilesList
  53. int& iCharCount //number of characters in pszFilesList. also returns the number of characters in the return string
  54. );
  55. TCHAR* ProcessOneFile (TCHAR* pszPath, //directory in which the files are located
  56. const TCHAR* pszFilesList, //NULL separated list of filenames
  57. int iFileCount, //number of files in pszFilesList
  58. int& iCharCount //number of characters in pszFilesList. also returns the number of characters in the return string
  59. );
  60. HWND GetPrimaryAppWindow (void);
  61. BOOL InitRPCServer (void);
  62. RPC_BINDING_HANDLE GetRpcHandle (void);
  63. void CreateLinks(void);
  64. void RemoveLinks(void);
  65. HRESULT CreateShortcut (LPCTSTR lpszExe, LPCTSTR lpszLink, LPCTSTR lpszDesc);
  66. BOOL GetShortcutInfo (LPTSTR lpszShortcutName, LPTSTR lpszFullExeName);
  67. BOOL GetSendToInfo (LPTSTR lpszSendToName, LPTSTR lpszFullExeName);
  68. typedef struct tagErrorToStringId
  69. {
  70. DWORD WinError;
  71. int StringId;
  72. } ERROR_TO_STRING_ID, *PERROR_TO_STRING_ID;
  73. #endif //_UTILS_H__