This commit is contained in:
2013-08-22 05:26:36 +00:00
parent bc592fe251
commit 6c0348d77f
12 changed files with 1470 additions and 0 deletions

View File

@@ -0,0 +1,149 @@
// MakeManualList.cpp : Defines the class behaviors for the application.
//
#include "stdafx.h"
#include "MakeManualList.h"
#include "MakeManualListDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMakeManualListApp
BEGIN_MESSAGE_MAP(CMakeManualListApp, CWinApp)
//{{AFX_MSG_MAP(CMakeManualListApp)
// 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()
/////////////////////////////////////////////////////////////////////////////
// CMakeManualListApp construction
CMakeManualListApp::CMakeManualListApp()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CMakeManualListApp object
CMakeManualListApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CMakeManualListApp initialization
BOOL CMakeManualListApp::InitInstance()
{
AfxOleInit(); // <= Ãß°¡ÇÑ °ÍÀÓ
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
SetRegistryKey(_T("DnaSoft"));
GetApplicationSettings();
CMakeManualListDlg 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
}
// Since the dialog has been closed, return FALSE so that we exit the
// application, rather than start the application's message pump.
return FALSE;
}
int CMakeManualListApp::ExitInstance()
{
SaveApplicationSettings();
return CWinApp::ExitInstance();
}
void CMakeManualListApp::GetApplicationSettings()
{
HKEY hSecKey = GetSectionKey("Settings");
/*
DWORD dwType;
m_AppConfig.rcWindow.bottom = 500;
DWORD dwData = sizeof(RECT);
if (RegQueryValueEx(hSecKey, "WindowRect", NULL, &dwType,
(LPBYTE)&m_AppConfig.rcWindow, &dwData) == ERROR_SUCCESS)
{
}
m_AppConfig.strSBAddr = GetProfileString( "SBConfig", "SBAddress", "127.0.0.1" );
m_AppConfig.lSBPort = GetProfileInt( "SBConfig", "SBPort", 5050 );
LPBYTE ppData = 0;
UINT pBytes=0;
if( GetProfileBinary("Config", "Max", &ppData, &pBytes) )
memcpy( &g_AppConfig.fMax, ppData, sizeof(float) );
*/
g_AppConfig.bUsingAmountUp = GetProfileInt( "Config", "UsingAmountUp", TRUE );
g_AppConfig.bUsingAmountDown = GetProfileInt( "Config", "UsingAmountDown", TRUE );
g_AppConfig.bUsingCurUp = GetProfileInt( "Config", "UsingCurUp", TRUE );
g_AppConfig.bUsingCurDown = GetProfileInt( "Config", "UsingCurDown", TRUE );
g_AppConfig.bUsingExchange = GetProfileInt( "Config", "UsingExchange", TRUE );
g_AppConfig.bUsingKosdaq = GetProfileInt( "Config", "UsingKosdaq", TRUE );
g_AppConfig.nAmountUp = GetProfileInt( "Config", "AmountUp", 100000000 );
g_AppConfig.nAmountDown = GetProfileInt( "Config", "AmountDown", 100000 );
g_AppConfig.nCurUp = GetProfileInt( "Config", "CurUp", 50000 );
g_AppConfig.nCurDown = GetProfileInt( "Config", "CurDown", 500 );
}
void CMakeManualListApp::SaveApplicationSettings()
{
HKEY hSecKey = GetSectionKey("Settings");
/*
RegSetValueEx(hSecKey, "WindowRect", 0, REG_DWORD,
(LPBYTE)&m_AppConfig.rcWindow, sizeof(RECT));
WriteProfileString( "SBConfig", "SBAddress", m_AppConfig.strSBAddr );
WriteProfileInt( "SBConfig", "SBPort", m_AppConfig.lSBPort );
BYTE pData[4];
UINT nBytes=4;
memcpy( pData, &g_AppConfig.nContinueTime, sizeof(long) );
WriteProfileBinary( "Config", "ContinueTime", pData, nBytes);
*/
WriteProfileInt( "Config", "UsingAmountUp", g_AppConfig.bUsingAmountUp );
WriteProfileInt( "Config", "UsingAmountDown", g_AppConfig.bUsingAmountDown );
WriteProfileInt( "Config", "UsingCurUp", g_AppConfig.bUsingCurUp );
WriteProfileInt( "Config", "UsingCurDown", g_AppConfig.bUsingCurDown );
WriteProfileInt( "Config", "UsingExchange", g_AppConfig.bUsingExchange );
WriteProfileInt( "Config", "UsingKosdaq", g_AppConfig.bUsingKosdaq );
WriteProfileInt( "Config", "AmountUp", g_AppConfig.nAmountUp );
WriteProfileInt( "Config", "AmountDown", g_AppConfig.nAmountDown );
WriteProfileInt( "Config", "CurUp", g_AppConfig.nCurUp );
WriteProfileInt( "Config", "CurDown", g_AppConfig.nCurDown );
}