Main Page | File List

TransClient.cpp

00001 // TransClient.cpp : Defines the class behaviors for the application.
00002 //
00003 
00004 #include "stdafx.h"
00005 #include "TransClient.h"
00006 
00007 #include "MainFrm.h"
00008 #include "TransClientDoc.h"
00009 #include "TransClientView.h"
00010 #include "Client.h"
00011 
00012 #ifdef _DEBUG
00013 #define new DEBUG_NEW
00014 #undef THIS_FILE
00015 static char THIS_FILE[] = __FILE__;
00016 #endif
00017 
00019 // CTransClientApp
00020 
00021 BEGIN_MESSAGE_MAP(CTransClientApp, CWinApp)
00022         //{{AFX_MSG_MAP(CTransClientApp)
00023         ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
00024                 // NOTE - the ClassWizard will add and remove mapping macros here.
00025                 //    DO NOT EDIT what you see in these blocks of generated code!
00026         //}}AFX_MSG_MAP
00027         // Standard file based document commands
00028         ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
00029         ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
00030         // Standard print setup command
00031         ON_COMMAND(ID_FILE_PRINT_SETUP, CWinApp::OnFilePrintSetup)
00032 END_MESSAGE_MAP()
00033 
00035 // CTransClientApp construction
00036 
00037 CTransClientApp::CTransClientApp()
00038 {
00039         // TODO: add construction code here,
00040         // Place all significant initialization in InitInstance
00041 }
00042 
00044 // The one and only CTransClientApp object
00045 
00046 CTransClientApp theApp;
00047 FILE* video;
00048 HWND  pPlayer;
00049 char  ServerAddress[20];
00050 CClient m_client;
00051 bool VideoIsRequested;
00052 
00054 // CTransClientApp initialization
00055 
00056 BOOL CTransClientApp::InitInstance()
00057 {
00058         AfxEnableControlContainer();
00059 
00060         // Standard initialization
00061         // If you are not using these features and wish to reduce the size
00062         //  of your final executable, you should remove from the following
00063         //  the specific initialization routines you do not need.
00064 
00065 #ifdef _AFXDLL
00066         Enable3dControls();                     // Call this when using MFC in a shared DLL
00067 #else
00068         Enable3dControlsStatic();       // Call this when linking to MFC statically
00069 #endif
00070 
00071         // Change the registry key under which our settings are stored.
00072         // TODO: You should modify this string to be something appropriate
00073         // such as the name of your company or organization.
00074         SetRegistryKey(_T("Local AppWizard-Generated Applications"));
00075 
00076         LoadStdProfileSettings();  // Load standard INI file options (including MRU)
00077 
00078         // Register the application's document templates.  Document templates
00079         //  serve as the connection between documents, frame windows and views.
00080 
00081         CSingleDocTemplate* pDocTemplate;
00082         pDocTemplate = new CSingleDocTemplate(
00083                 IDR_MAINFRAME,
00084                 RUNTIME_CLASS(CTransClientDoc),
00085                 RUNTIME_CLASS(CMainFrame),       // main SDI frame window
00086                 RUNTIME_CLASS(CTransClientView));
00087         AddDocTemplate(pDocTemplate);
00088 
00089         // Parse command line for standard shell commands, DDE, file open
00090         CCommandLineInfo cmdInfo;
00091         ParseCommandLine(cmdInfo);
00092 
00093         // Dispatch commands specified on the command line
00094         if (!ProcessShellCommand(cmdInfo))
00095                 return FALSE;
00096 
00097         // The one and only window has been initialized, so show and update it.
00098         m_pMainWnd->ShowWindow(SW_SHOW);
00099         m_pMainWnd->UpdateWindow();
00100 
00101         (AfxGetMainWnd( ))->SetWindowText("Video Transcoding Client");
00102         return TRUE;
00103 }
00104 
00105 
00107 // CAboutDlg dialog used for App About
00108 
00109 class CAboutDlg : public CDialog
00110 {
00111 public:
00112         CAboutDlg();
00113 
00114 // Dialog Data
00115         //{{AFX_DATA(CAboutDlg)
00116         enum { IDD = IDD_ABOUTBOX };
00117         //}}AFX_DATA
00118 
00119         // ClassWizard generated virtual function overrides
00120         //{{AFX_VIRTUAL(CAboutDlg)
00121         protected:
00122         virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00123         //}}AFX_VIRTUAL
00124 
00125 // Implementation
00126 protected:
00127         //{{AFX_MSG(CAboutDlg)
00128                 // No message handlers
00129         //}}AFX_MSG
00130         DECLARE_MESSAGE_MAP()
00131 };
00132 
00133 CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
00134 {
00135         //{{AFX_DATA_INIT(CAboutDlg)
00136         //}}AFX_DATA_INIT
00137 }
00138 
00139 void CAboutDlg::DoDataExchange(CDataExchange* pDX)
00140 {
00141         CDialog::DoDataExchange(pDX);
00142         //{{AFX_DATA_MAP(CAboutDlg)
00143         //}}AFX_DATA_MAP
00144 }
00145 
00146 BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
00147         //{{AFX_MSG_MAP(CAboutDlg)
00148                 // No message handlers
00149         //}}AFX_MSG_MAP
00150 END_MESSAGE_MAP()
00151 
00152 // App command to run the dialog
00153 void CTransClientApp::OnAppAbout()
00154 {
00155         CAboutDlg aboutDlg;
00156         aboutDlg.DoModal();
00157 }
00158 
00160 // CTransClientApp message handlers
00161 

Generated on Mon May 8 22:27:08 2006 by  doxygen 1.3.9.1