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.

74 lines
1.4 KiB

  1. /*************************************************************************
  2. FileName : FileSave.cpp
  3. Purpose : Implementation of CFileSave
  4. Methods
  5. defined : OpenFileSaveDlg
  6. Properties
  7. defined :
  8. FileName
  9. Helper
  10. functions: GET_BSTR
  11. Author : Sudha Srinivasan (a-sudsi)
  12. *************************************************************************/
  13. #include "stdafx.h"
  14. #include "SAFRCFileDlg.h"
  15. #include "FileSave.h"
  16. #include "DlgWindow.h"
  17. CComBSTR g_bstrFileName;
  18. CComBSTR g_bstrFileType;
  19. BOOL g_bFileNameSet = FALSE;
  20. /////////////////////////////////////////////////////////////////////////////
  21. // CFileSave
  22. STDMETHODIMP CFileSave::OpenFileSaveDlg(DWORD *pdwRetVal)
  23. {
  24. HRESULT hr = S_OK;
  25. if (NULL == pdwRetVal)
  26. {
  27. hr = S_FALSE;
  28. goto done;
  29. }
  30. *pdwRetVal = SaveTheFile();
  31. done:
  32. return hr;
  33. }
  34. STDMETHODIMP CFileSave::get_FileName(BSTR *pVal)
  35. {
  36. GET_BSTR(pVal, g_bstrFileName);
  37. return S_OK;
  38. }
  39. STDMETHODIMP CFileSave::put_FileName(BSTR newVal)
  40. {
  41. g_bstrFileName = newVal;
  42. g_bFileNameSet = TRUE;
  43. return S_OK;
  44. }
  45. STDMETHODIMP CFileSave::get_FileType(BSTR *pVal)
  46. {
  47. GET_BSTR(pVal, g_bstrFileType);
  48. return S_OK;
  49. }
  50. STDMETHODIMP CFileSave::put_FileType(BSTR newVal)
  51. {
  52. g_bstrFileType = newVal;
  53. return S_OK;
  54. }
  55. void CFileSave::GET_BSTR(BSTR *&x, CComBSTR &y)
  56. {
  57. if (x != NULL)
  58. *x = y.Copy();
  59. }