123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- // CPhotoFTPSend.cpp : Defines the class behaviors for the application.
- //
- #include "stdafx.h"
- #include "CPhotoFTPSend.h"
- #include "CPhotoFTPSendDlg.h"
- #include "FTPSend2.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CCPhotoFTPSendApp
- BEGIN_MESSAGE_MAP(CCPhotoFTPSendApp, CWinApp)
- //{{AFX_MSG_MAP(CCPhotoFTPSendApp)
- // NOTE - the ClassWizard will add and remove mapping macros here.
- // DO NOT EDIT what you see in these blocks of generated code!
- //}}AFX_MSG
- ON_COMMAND(ID_HELP, CWinApp::OnHelp)
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CCPhotoFTPSendApp construction
- CCPhotoFTPSendApp::CCPhotoFTPSendApp()
- {
- // TODO: add construction code here,
- // Place all significant initialization in InitInstance
- }
- /////////////////////////////////////////////////////////////////////////////
- // The one and only CCPhotoFTPSendApp object
- CCPhotoFTPSendApp theApp;
- /////////////////////////////////////////////////////////////////////////////
- // CCPhotoFTPSendApp initialization
- BOOL CCPhotoFTPSendApp::InitInstance()
- {
- HANDLE hObject = CreateMutex(NULL,FALSE,_T("CCPhotoFTPSendApp"));
- if(GetLastError() == ERROR_ALREADY_EXISTS)
- {
- return false;
- }
- AfxEnableControlContainer();
- // Standard initialization
- // If you are not using these features and wish to reduce the size
- // of your final executable, you should remove from the following
- // the specific initialization routines you do not need.
- #ifdef _AFXDLL
- Enable3dControls(); // Call this when using MFC in a shared DLL
- #else
- Enable3dControlsStatic(); // Call this when linking to MFC statically
- #endif
- #ifdef TESTLOCAL // ²âÊÔ;
- CFTPSend2 *pSend = new CFTPSend2;
- pSend->LogOnToServer(TEST_SERVER,21,_T("photo1account"),_T("lyfzphoto1account"));
- pSend->MoveFile(_T("20150511123051556633.ly.com\\20131017-001\\001.jpg"),_T("D:\\Program Files\\¼ò½à\\001.jpg"),FALSE);
- pSend->LogOffServer();
- return FALSE;
- #endif
- if(!AfxSocketInit())
- {
- AfxMessageBox(IDP_SOCKETS_INIT_FAILED);
- return FALSE;
- }
- SetRegistryKey(_T("LYFZ-FTPSEND"));
- GdiplusStartupInput gdiplusStartupInput;
- GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);
- CCPhotoFTPSendDlg dlg;
- m_pMainWnd = &dlg;
- int nResponse = dlg.DoModal();
- if (nResponse == IDOK)
- {
- // TODO: Place code here to handle when the dialog is
- // dismissed with OK
- }
- else if (nResponse == IDCANCEL)
- {
- // TODO: Place code here to handle when the dialog is
- // dismissed with Cancel
- }
- //¹Ø±ÕgdiplusµÄ»·¾³
- GdiplusShutdown(gdiplusToken);
- // Since the dialog has been closed, return FALSE so that we exit the
- // application, rather than start the application's message pump.
- return FALSE;
- }
|