CPhotoFTPSend.cpp 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. // CPhotoFTPSend.cpp : Defines the class behaviors for the application.
  2. //
  3. #include "stdafx.h"
  4. #include "CPhotoFTPSend.h"
  5. #include "CPhotoFTPSendDlg.h"
  6. #include "FTPSend2.h"
  7. #ifdef _DEBUG
  8. #define new DEBUG_NEW
  9. #undef THIS_FILE
  10. static char THIS_FILE[] = __FILE__;
  11. #endif
  12. /////////////////////////////////////////////////////////////////////////////
  13. // CCPhotoFTPSendApp
  14. BEGIN_MESSAGE_MAP(CCPhotoFTPSendApp, CWinApp)
  15. //{{AFX_MSG_MAP(CCPhotoFTPSendApp)
  16. // NOTE - the ClassWizard will add and remove mapping macros here.
  17. // DO NOT EDIT what you see in these blocks of generated code!
  18. //}}AFX_MSG
  19. ON_COMMAND(ID_HELP, CWinApp::OnHelp)
  20. END_MESSAGE_MAP()
  21. /////////////////////////////////////////////////////////////////////////////
  22. // CCPhotoFTPSendApp construction
  23. CCPhotoFTPSendApp::CCPhotoFTPSendApp()
  24. {
  25. // TODO: add construction code here,
  26. // Place all significant initialization in InitInstance
  27. }
  28. /////////////////////////////////////////////////////////////////////////////
  29. // The one and only CCPhotoFTPSendApp object
  30. CCPhotoFTPSendApp theApp;
  31. /////////////////////////////////////////////////////////////////////////////
  32. // CCPhotoFTPSendApp initialization
  33. BOOL CCPhotoFTPSendApp::InitInstance()
  34. {
  35. HANDLE hObject = CreateMutex(NULL,FALSE,_T("CCPhotoFTPSendApp"));
  36. if(GetLastError() == ERROR_ALREADY_EXISTS)
  37. {
  38. return false;
  39. }
  40. AfxEnableControlContainer();
  41. // Standard initialization
  42. // If you are not using these features and wish to reduce the size
  43. // of your final executable, you should remove from the following
  44. // the specific initialization routines you do not need.
  45. #ifdef _AFXDLL
  46. Enable3dControls(); // Call this when using MFC in a shared DLL
  47. #else
  48. Enable3dControlsStatic(); // Call this when linking to MFC statically
  49. #endif
  50. #ifdef TESTLOCAL // ²âÊÔ;
  51. CFTPSend2 *pSend = new CFTPSend2;
  52. pSend->LogOnToServer(TEST_SERVER,21,_T("photo1account"),_T("lyfzphoto1account"));
  53. pSend->MoveFile(_T("20150511123051556633.ly.com\\20131017-001\\001.jpg"),_T("D:\\Program Files\\¼ò½à\\001.jpg"),FALSE);
  54. pSend->LogOffServer();
  55. return FALSE;
  56. #endif
  57. if(!AfxSocketInit())
  58. {
  59. AfxMessageBox(IDP_SOCKETS_INIT_FAILED);
  60. return FALSE;
  61. }
  62. SetRegistryKey(_T("LYFZ-FTPSEND"));
  63. GdiplusStartupInput gdiplusStartupInput;
  64. GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);
  65. CCPhotoFTPSendDlg dlg;
  66. m_pMainWnd = &dlg;
  67. int nResponse = dlg.DoModal();
  68. if (nResponse == IDOK)
  69. {
  70. // TODO: Place code here to handle when the dialog is
  71. // dismissed with OK
  72. }
  73. else if (nResponse == IDCANCEL)
  74. {
  75. // TODO: Place code here to handle when the dialog is
  76. // dismissed with Cancel
  77. }
  78. //¹Ø±ÕgdiplusµÄ»·¾³
  79. GdiplusShutdown(gdiplusToken);
  80. // Since the dialog has been closed, return FALSE so that we exit the
  81. // application, rather than start the application's message pump.
  82. return FALSE;
  83. }