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.

73 lines
1.5 KiB

  1. /*************************************************************************
  2. FileName : FileOpen.cpp
  3. Purpose : Implementation of CFileOpen
  4. Methods
  5. defined : OpenFileOpenDlg
  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 "FileOpen.h"
  16. #include "DlgWindow.h"
  17. CComBSTR g_bstrOpenFileName;
  18. CComBSTR g_bstrOpenFileSize;
  19. BOOL g_bOpenFileNameSet = FALSE;
  20. /////////////////////////////////////////////////////////////////////////////
  21. // CFileOpen
  22. STDMETHODIMP CFileOpen::OpenFileOpenDlg(DWORD *pdwRetVal)
  23. {
  24. // TODO: Add your implementation code here
  25. HRESULT hr = S_OK;
  26. if (NULL == pdwRetVal)
  27. {
  28. hr = S_FALSE;
  29. goto done;
  30. }
  31. *pdwRetVal = OpenTheFile(NULL);
  32. done:
  33. return hr ;
  34. }
  35. void CFileOpen::GET_BSTR (BSTR*& x, CComBSTR& y)
  36. {
  37. if (x!=NULL)
  38. *x = y.Copy();
  39. }
  40. STDMETHODIMP CFileOpen::get_FileName(BSTR *pVal)
  41. {
  42. // TODO: Add your implementation code here
  43. GET_BSTR(pVal, g_bstrOpenFileName);
  44. return S_OK;
  45. }
  46. STDMETHODIMP CFileOpen::put_FileName(BSTR newVal)
  47. {
  48. // TODO: Add your implementation code here
  49. g_bstrOpenFileName = newVal;
  50. g_bOpenFileNameSet = TRUE;
  51. return S_OK;
  52. }
  53. STDMETHODIMP CFileOpen::get_FileSize(BSTR *pVal)
  54. {
  55. // TODO: Add your implementation code here
  56. *pVal = g_bstrOpenFileSize.Copy();
  57. return S_OK;
  58. }