|
// SimpleAutoTask.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "TravianAutoTask.h"
#include "MainFrm.h"
#include "FormTask.h"
#include "AboutDlg.h"
/*
// The one and only application object
CWinApp theApp;
using namespace std;
// In this case (Use Windows Console App with MFC CWinApp, the _tmain will be called by CWinApp::Run()??
int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
{
int nRetCode = 0;
// initialize MFC and print and error on failure
if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0))
{
// TODO: change error code to suit your needs
_tprintf(_T("Fatal Error: MFC initialization failed\n"));
nRetCode = 1;
}
else if (!AfxOleInit())
{
_tprintf(_T("Fatal Error: OLE initialization failed\n"));
nRetCode = 1;
// TODO: code your application's behavior here.
}
return nRetCode;
}
*/
BEGIN_MESSAGE_MAP(CAutoTaskApp, CWinApp)
ON_COMMAND(ID_APP_ABOUT, &CAutoTaskApp::OnAppAbout)
END_MESSAGE_MAP()
// CYahooApp construction
CAutoTaskApp::CAutoTaskApp()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
}
// The one and only CYahooApp object
CAutoTaskApp theApp;
CEventLog g_TravianEvtLog(NULL, _T("TravianAutoTask"));
COLORREF g_crBkgnd(RGB(0xFF, 0xFB, 0xF0));
// CYahooApp initialization
BOOL CAutoTaskApp::InitInstance()
{
// enable memory leak accurate dump
_CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
InitCommonControls();
CWinApp::InitInstance();
AfxEnableControlContainer();
if (!AfxOleInit())
{
AfxMessageBox(_T("Fatal Error: OLE initialization failed\n"), (MB_OK|MB_ICONSTOP));
return FALSE;
// TODO: code your application's behavior here.
}
// This will load RichEdit 2.0 DLL.
AfxInitRichEdit2 ();
CMainFrm* pMainFrame = new CMainFrm;
if (! ((CMainFrm*)pMainFrame)->LoadFrame(IDR_MAIN,
WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE, NULL, NULL) )
{
// free the memory
delete pMainFrame;
return FALSE;
}
m_mXP.LoadMenu(IDR_MAIN);
m_mXP.LoadToolbar(IDR_TOOLBAR256);
m_mXP.SetIconSize(16,16);
pMainFrame->SetMenu(&m_mXP);
pMainFrame->ShowWindow(SW_MAXIMIZE);
pMainFrame->UpdateWindow();
m_pMainWnd = pMainFrame;
pMainFrame->Init();
return TRUE;
/*
CDlgMain dlg;
m_pMainWnd = &dlg;
INT_PTR 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
}
*/
// Since the dialog has been closed, return FALSE so that we exit the
// application, rather than start the application's message pump.
return FALSE;
}
void CAutoTaskApp::OnAppAbout()
{
// TODO: Add your command handler code here
CAboutDlg dlgAbout;
dlgAbout.DoModal();
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.
A list of licenses authors might use can be found here
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.