This commit is contained in:
142
MakeRefusalList/MakeRefusalList.cpp
Normal file
142
MakeRefusalList/MakeRefusalList.cpp
Normal file
@@ -0,0 +1,142 @@
|
||||
// MakeRefusalList.cpp : Defines the class behaviors for the application.
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "MakeRefusalList.h"
|
||||
#include "MakeRefusalListDlg.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMakeRefusalListApp
|
||||
|
||||
BEGIN_MESSAGE_MAP(CMakeRefusalListApp, CWinApp)
|
||||
//{{AFX_MSG_MAP(CMakeRefusalListApp)
|
||||
// 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()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMakeRefusalListApp construction
|
||||
|
||||
CMakeRefusalListApp::CMakeRefusalListApp()
|
||||
{
|
||||
// TODO: add construction code here,
|
||||
// Place all significant initialization in InitInstance
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// The one and only CMakeRefusalListApp object
|
||||
|
||||
CMakeRefusalListApp theApp;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMakeRefusalListApp initialization
|
||||
|
||||
BOOL CMakeRefusalListApp::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();
|
||||
|
||||
CMakeRefusalListDlg 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 CMakeRefusalListApp::ExitInstance()
|
||||
{
|
||||
SaveApplicationSettings();
|
||||
return CWinApp::ExitInstance();
|
||||
}
|
||||
|
||||
|
||||
void CMakeRefusalListApp::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.bUsingAmount = GetProfileInt( "Config", "UsingAmount", TRUE );
|
||||
g_AppConfig.bUsingBM = GetProfileInt( "Config", "UsingBM", TRUE );
|
||||
g_AppConfig.bUsingExchange = GetProfileInt( "Config", "UsingExchange", TRUE );
|
||||
g_AppConfig.bUsingKosdaq = GetProfileInt( "Config", "UsingKosdaq", TRUE );
|
||||
|
||||
g_AppConfig.nAmount = GetProfileInt( "Config", "AmountValue", 1000 );
|
||||
g_AppConfig.nBM = GetProfileInt( "Config", "BmValue", 10000 );
|
||||
}
|
||||
|
||||
void CMakeRefusalListApp::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", "UsingAmount", g_AppConfig.bUsingAmount );
|
||||
WriteProfileInt( "Config", "UsingBM", g_AppConfig.bUsingBM );
|
||||
WriteProfileInt( "Config", "UsingExchange", g_AppConfig.bUsingExchange );
|
||||
WriteProfileInt( "Config", "UsingKosdaq", g_AppConfig.bUsingKosdaq );
|
||||
|
||||
WriteProfileInt( "Config", "AmountValue", g_AppConfig.nAmount );
|
||||
WriteProfileInt( "Config", "BmValue", g_AppConfig.nBM );
|
||||
}
|
||||
|
||||
54
MakeRefusalList/MakeRefusalList.h
Normal file
54
MakeRefusalList/MakeRefusalList.h
Normal file
@@ -0,0 +1,54 @@
|
||||
// MakeRefusalList.h : main header file for the MAKEREFUSALLIST application
|
||||
//
|
||||
|
||||
#if !defined(AFX_MAKEREFUSALLIST_H__F5B7722E_EA1B_4354_B4C7_909330209DD5__INCLUDED_)
|
||||
#define AFX_MAKEREFUSALLIST_H__F5B7722E_EA1B_4354_B4C7_909330209DD5__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#ifndef __AFXWIN_H__
|
||||
#error include 'stdafx.h' before including this file for PCH
|
||||
#endif
|
||||
|
||||
#include "resource.h" // main symbols
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMakeRefusalListApp:
|
||||
// See MakeRefusalList.cpp for the implementation of this class
|
||||
//
|
||||
|
||||
class CMakeRefusalListApp : public CWinApp
|
||||
{
|
||||
public:
|
||||
CMakeRefusalListApp();
|
||||
|
||||
private:
|
||||
void GetApplicationSettings();
|
||||
void SaveApplicationSettings();
|
||||
|
||||
// Overrides
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CMakeRefusalListApp)
|
||||
public:
|
||||
virtual BOOL InitInstance();
|
||||
virtual int ExitInstance();
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
|
||||
//{{AFX_MSG(CMakeRefusalListApp)
|
||||
// NOTE - the ClassWizard will add and remove member functions here.
|
||||
// DO NOT EDIT what you see in these blocks of generated code !
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_MAKEREFUSALLIST_H__F5B7722E_EA1B_4354_B4C7_909330209DD5__INCLUDED_)
|
||||
218
MakeRefusalList/MakeRefusalList.rc
Normal file
218
MakeRefusalList/MakeRefusalList.rc
Normal file
@@ -0,0 +1,218 @@
|
||||
//Microsoft Developer Studio generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "afxres.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Korean resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_KOR)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_KOREAN, SUBLANG_DEFAULT
|
||||
#pragma code_page(949)
|
||||
#endif //_WIN32
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"#include ""afxres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"#define _AFX_NO_SPLITTER_RESOURCES\r\n"
|
||||
"#define _AFX_NO_OLE_RESOURCES\r\n"
|
||||
"#define _AFX_NO_TRACKER_RESOURCES\r\n"
|
||||
"#define _AFX_NO_PROPERTY_RESOURCES\r\n"
|
||||
"\r\n"
|
||||
"#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_KOR)\r\n"
|
||||
"#ifdef _WIN32\r\n"
|
||||
"LANGUAGE 18, 1\r\n"
|
||||
"#pragma code_page(949)\r\n"
|
||||
"#endif //_WIN32\r\n"
|
||||
"#include ""res\\MakeRefusalList.rc2"" // non-Microsoft Visual C++ edited resources\r\n"
|
||||
"#include ""l.kor\\afxres.rc"" // Standard components\r\n"
|
||||
"#endif\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Icon
|
||||
//
|
||||
|
||||
// Icon with lowest ID value placed first to ensure application icon
|
||||
// remains consistent on all systems.
|
||||
IDR_MAINFRAME ICON DISCARDABLE "res\\MakeRefusalList.ico"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
|
||||
IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 235, 55
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "MakeRefusalList 정보"
|
||||
FONT 9, "굴림"
|
||||
BEGIN
|
||||
ICON IDR_MAINFRAME,IDC_STATIC,11,17,20,20
|
||||
LTEXT "MakeRefusalList 버전 1.0",IDC_STATIC,40,10,119,8,
|
||||
SS_NOPREFIX
|
||||
LTEXT "Copyright (C) 2003",IDC_STATIC,40,25,119,8
|
||||
DEFPUSHBUTTON "확인",IDOK,178,7,50,14,WS_GROUP
|
||||
END
|
||||
|
||||
IDD_MAKEREFUSALLIST_DIALOG DIALOGEX 0, 0, 191, 155
|
||||
STYLE DS_MODALFRAME | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION |
|
||||
WS_SYSMENU
|
||||
EXSTYLE WS_EX_APPWINDOW
|
||||
CAPTION "당일 거래부진 종목검색"
|
||||
FONT 9, "굴림"
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "검색 시작",IDC_RUN_BTN,59,132,71,17
|
||||
CONTROL "당일 거래량 :",IDC_USING_AMOUNT_CHECK,"Button",
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,13,20,56,8
|
||||
CONTROL "당일 거래대금 :",IDC_USING_BM_CHECK,"Button",
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,13,35,60,8
|
||||
EDITTEXT IDC_AMOUNT_EDIT,74,17,67,14,ES_RIGHT | ES_AUTOHSCROLL |
|
||||
ES_NUMBER
|
||||
EDITTEXT IDC_BM_EDIT,74,34,67,14,ES_RIGHT | ES_AUTOHSCROLL |
|
||||
ES_NUMBER
|
||||
CONTROL "코스닥",IDC_USING_KOSDAQ_CHECK,"Button",BS_AUTOCHECKBOX |
|
||||
WS_TABSTOP,13,50,36,8
|
||||
CONTROL "거래소",IDC_USING_EXCHANGE_CHECK,"Button",
|
||||
BS_AUTOCHECKBOX | WS_TABSTOP,13,65,36,8
|
||||
LTEXT "(천원) 이하",IDC_STATIC,143,38,37,9
|
||||
LTEXT "이하",IDC_STATIC,143,23,31,9
|
||||
LTEXT "출력파일명:",IDC_STATIC,11,82,38,9
|
||||
EDITTEXT IDC_OUTPUTFILENAME_EDIT,50,79,128,14,ES_AUTOHSCROLL
|
||||
CONTROL "Progress1",IDC_RUN_PROGRESS,"msctls_progress32",
|
||||
PBS_SMOOTH | WS_BORDER,7,114,177,12
|
||||
CTEXT "진행상황",IDC_PROGRESS_STATIC,7,103,177,10,
|
||||
SS_CENTERIMAGE
|
||||
GROUPBOX "조건",IDC_STATIC,7,5,177,93
|
||||
END
|
||||
|
||||
|
||||
#ifndef _MAC
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 1,0,0,1
|
||||
PRODUCTVERSION 1,0,0,1
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x4L
|
||||
FILETYPE 0x1L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "041204B0"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "\0"
|
||||
VALUE "FileDescription", "MakeRefusalList MFC 응용 프로그램\0"
|
||||
VALUE "FileVersion", "1, 0, 0, 1\0"
|
||||
VALUE "InternalName", "MakeRefusalList\0"
|
||||
VALUE "LegalCopyright", "Copyright (C) 2003\0"
|
||||
VALUE "LegalTrademarks", "\0"
|
||||
VALUE "OriginalFilename", "MakeRefusalList.EXE\0"
|
||||
VALUE "ProductName", "MakeRefusalList 응용 프로그램\0"
|
||||
VALUE "ProductVersion", "1, 0, 0, 1\0"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x412, 1200
|
||||
END
|
||||
END
|
||||
|
||||
#endif // !_MAC
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DESIGNINFO
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
GUIDELINES DESIGNINFO DISCARDABLE
|
||||
BEGIN
|
||||
IDD_ABOUTBOX, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 228
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 48
|
||||
END
|
||||
END
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// String Table
|
||||
//
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
IDS_ABOUTBOX "MakeRefusalList 정보(&A)..."
|
||||
END
|
||||
|
||||
#endif // Korean resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
#define _AFX_NO_SPLITTER_RESOURCES
|
||||
#define _AFX_NO_OLE_RESOURCES
|
||||
#define _AFX_NO_TRACKER_RESOURCES
|
||||
#define _AFX_NO_PROPERTY_RESOURCES
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_KOR)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE 18, 1
|
||||
#pragma code_page(949)
|
||||
#endif //_WIN32
|
||||
#include "res\MakeRefusalList.rc2" // non-Microsoft Visual C++ edited resources
|
||||
#include "l.kor\afxres.rc" // Standard components
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
||||
20
MakeRefusalList/MakeRefusalList.sln
Normal file
20
MakeRefusalList/MakeRefusalList.sln
Normal file
@@ -0,0 +1,20 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 10.00
|
||||
# Visual Studio 2008
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MakeRefusalList", "MakeRefusalList.vcproj", "{4200A8B8-F1EB-4000-89BB-61CF0F6DE487}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{4200A8B8-F1EB-4000-89BB-61CF0F6DE487}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{4200A8B8-F1EB-4000-89BB-61CF0F6DE487}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{4200A8B8-F1EB-4000-89BB-61CF0F6DE487}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{4200A8B8-F1EB-4000-89BB-61CF0F6DE487}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
320
MakeRefusalList/MakeRefusalList.vcproj
Normal file
320
MakeRefusalList/MakeRefusalList.vcproj
Normal file
@@ -0,0 +1,320 @@
|
||||
<?xml version="1.0" encoding="ks_c_5601-1987"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9.00"
|
||||
Name="MakeRefusalList"
|
||||
ProjectGUID="{4200A8B8-F1EB-4000-89BB-61CF0F6DE487}"
|
||||
Keyword="MFCProj"
|
||||
TargetFrameworkVersion="0"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="1"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
MkTypLibCompatible="true"
|
||||
SuppressStartupBanner="true"
|
||||
TargetEnvironment="1"
|
||||
TypeLibraryName=".\Release/MakeRefusalList.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderThrough="stdafx.h"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1042"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
UACExecutionLevel="2"
|
||||
SubSystem="2"
|
||||
DataExecutionPrevention="0"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
CommandLine=""
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="1"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
MkTypLibCompatible="true"
|
||||
SuppressStartupBanner="true"
|
||||
TargetEnvironment="1"
|
||||
TypeLibraryName=".\Debug/MakeRefusalList.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderThrough="stdafx.h"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1042"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
UACExecutionLevel="2"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="2"
|
||||
RandomizedBaseAddress="1"
|
||||
DataExecutionPrevention="0"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
CommandLine=""
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
>
|
||||
<File
|
||||
RelativePath="MakeRefusalList.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="MakeRefusalList.rc"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="MakeRefusalListDlg.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="StdAfx.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
UsePrecompiledHeader="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions=""
|
||||
UsePrecompiledHeader="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl"
|
||||
>
|
||||
<File
|
||||
RelativePath="MakeRefusalList.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="MakeRefusalListDlg.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="Resource.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="StdAfx.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||
>
|
||||
<File
|
||||
RelativePath="res\MakeRefusalList.ico"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="res\MakeRefusalList.rc2"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
575
MakeRefusalList/MakeRefusalListDlg.cpp
Normal file
575
MakeRefusalList/MakeRefusalListDlg.cpp
Normal file
@@ -0,0 +1,575 @@
|
||||
// MakeRefusalListDlg.cpp : implementation file
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "MakeRefusalList.h"
|
||||
#include "MakeRefusalListDlg.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CAboutDlg dialog used for App About
|
||||
|
||||
class CAboutDlg : public CDialog
|
||||
{
|
||||
public:
|
||||
CAboutDlg();
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CAboutDlg)
|
||||
enum { IDD = IDD_ABOUTBOX };
|
||||
//}}AFX_DATA
|
||||
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CAboutDlg)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
//{{AFX_MSG(CAboutDlg)
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
|
||||
{
|
||||
//{{AFX_DATA_INIT(CAboutDlg)
|
||||
//}}AFX_DATA_INIT
|
||||
}
|
||||
|
||||
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(CAboutDlg)
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
|
||||
//{{AFX_MSG_MAP(CAboutDlg)
|
||||
// No message handlers
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMakeRefusalListDlg dialog
|
||||
|
||||
CMakeRefusalListDlg::CMakeRefusalListDlg(CWnd* pParent /*=NULL*/)
|
||||
: CDialog(CMakeRefusalListDlg::IDD, pParent)
|
||||
{
|
||||
//{{AFX_DATA_INIT(CMakeRefusalListDlg)
|
||||
m_nAmount = 1000;
|
||||
m_nBM = 10000;
|
||||
m_strOutputFileName = _T("거부_전장거래부진종목코드.txt");
|
||||
//}}AFX_DATA_INIT
|
||||
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
|
||||
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
|
||||
}
|
||||
|
||||
void CMakeRefusalListDlg::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
//{{AFX_DATA_MAP(CMakeRefusalListDlg)
|
||||
DDX_Control(pDX, IDC_RUN_PROGRESS, m_hRunProgress);
|
||||
DDX_Text(pDX, IDC_AMOUNT_EDIT, m_nAmount);
|
||||
DDX_Text(pDX, IDC_BM_EDIT, m_nBM);
|
||||
DDX_Text(pDX, IDC_OUTPUTFILENAME_EDIT, m_strOutputFileName);
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
BEGIN_MESSAGE_MAP(CMakeRefusalListDlg, CDialog)
|
||||
//{{AFX_MSG_MAP(CMakeRefusalListDlg)
|
||||
ON_WM_SYSCOMMAND()
|
||||
ON_WM_PAINT()
|
||||
ON_WM_QUERYDRAGICON()
|
||||
ON_BN_CLICKED(IDC_USING_AMOUNT_CHECK, OnUsingAmountCheck)
|
||||
ON_BN_CLICKED(IDC_USING_BM_CHECK, OnUsingBmCheck)
|
||||
ON_WM_CLOSE()
|
||||
ON_BN_CLICKED(IDC_RUN_BTN, OnRunBtn)
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMakeRefusalListDlg message handlers
|
||||
|
||||
BOOL CMakeRefusalListDlg::OnInitDialog()
|
||||
{
|
||||
CDialog::OnInitDialog();
|
||||
|
||||
// Add "About..." menu item to system menu.
|
||||
|
||||
// IDM_ABOUTBOX must be in the system command range.
|
||||
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
|
||||
ASSERT(IDM_ABOUTBOX < 0xF000);
|
||||
|
||||
CMenu* pSysMenu = GetSystemMenu(FALSE);
|
||||
if (pSysMenu != NULL)
|
||||
{
|
||||
CString strAboutMenu;
|
||||
strAboutMenu.LoadString(IDS_ABOUTBOX);
|
||||
if (!strAboutMenu.IsEmpty())
|
||||
{
|
||||
pSysMenu->AppendMenu(MF_SEPARATOR);
|
||||
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
|
||||
}
|
||||
}
|
||||
|
||||
// Set the icon for this dialog. The framework does this automatically
|
||||
// when the application's main window is not a dialog
|
||||
SetIcon(m_hIcon, TRUE); // Set big icon
|
||||
SetIcon(m_hIcon, FALSE); // Set small icon
|
||||
|
||||
// TODO: Add extra initialization here
|
||||
((CButton*)GetDlgItem( IDC_USING_AMOUNT_CHECK ))->SetCheck(g_AppConfig.bUsingAmount);
|
||||
((CButton*)GetDlgItem( IDC_USING_BM_CHECK ))->SetCheck(g_AppConfig.bUsingBM);
|
||||
((CButton*)GetDlgItem( IDC_USING_KOSDAQ_CHECK ))->SetCheck(g_AppConfig.bUsingKosdaq);
|
||||
((CButton*)GetDlgItem( IDC_USING_EXCHANGE_CHECK ))->SetCheck(g_AppConfig.bUsingExchange);
|
||||
|
||||
((CWnd*)GetDlgItem( IDC_AMOUNT_EDIT ))->EnableWindow( g_AppConfig.bUsingAmount );
|
||||
((CWnd*)GetDlgItem( IDC_BM_EDIT ))->EnableWindow( g_AppConfig.bUsingBM );
|
||||
|
||||
m_nAmount = g_AppConfig.nAmount;
|
||||
m_nBM = g_AppConfig.nBM;
|
||||
|
||||
UpdateData(FALSE);
|
||||
return TRUE; // return TRUE unless you set the focus to a control
|
||||
}
|
||||
|
||||
void CMakeRefusalListDlg::OnSysCommand(UINT nID, LPARAM lParam)
|
||||
{
|
||||
if ((nID & 0xFFF0) == IDM_ABOUTBOX)
|
||||
{
|
||||
CAboutDlg dlgAbout;
|
||||
dlgAbout.DoModal();
|
||||
}
|
||||
else
|
||||
{
|
||||
CDialog::OnSysCommand(nID, lParam);
|
||||
}
|
||||
}
|
||||
|
||||
// If you add a minimize button to your dialog, you will need the code below
|
||||
// to draw the icon. For MFC applications using the document/view model,
|
||||
// this is automatically done for you by the framework.
|
||||
|
||||
void CMakeRefusalListDlg::OnPaint()
|
||||
{
|
||||
if (IsIconic())
|
||||
{
|
||||
CPaintDC dc(this); // device context for painting
|
||||
|
||||
SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
|
||||
|
||||
// Center icon in client rectangle
|
||||
int cxIcon = GetSystemMetrics(SM_CXICON);
|
||||
int cyIcon = GetSystemMetrics(SM_CYICON);
|
||||
CRect rect;
|
||||
GetClientRect(&rect);
|
||||
int x = (rect.Width() - cxIcon + 1) / 2;
|
||||
int y = (rect.Height() - cyIcon + 1) / 2;
|
||||
|
||||
// Draw the icon
|
||||
dc.DrawIcon(x, y, m_hIcon);
|
||||
}
|
||||
else
|
||||
{
|
||||
CDialog::OnPaint();
|
||||
}
|
||||
}
|
||||
|
||||
// The system calls this to obtain the cursor to display while the user drags
|
||||
// the minimized window.
|
||||
HCURSOR CMakeRefusalListDlg::OnQueryDragIcon()
|
||||
{
|
||||
return (HCURSOR) m_hIcon;
|
||||
}
|
||||
|
||||
void CMakeRefusalListDlg::OnUsingAmountCheck()
|
||||
{
|
||||
BOOL bCheck = ((CButton*)GetDlgItem( IDC_USING_AMOUNT_CHECK ))->GetCheck();
|
||||
((CWnd*)GetDlgItem( IDC_AMOUNT_EDIT ))->EnableWindow( bCheck );
|
||||
}
|
||||
|
||||
void CMakeRefusalListDlg::OnUsingBmCheck()
|
||||
{
|
||||
BOOL bCheck = ((CButton*)GetDlgItem( IDC_USING_BM_CHECK ))->GetCheck();
|
||||
((CWnd*)GetDlgItem( IDC_BM_EDIT ))->EnableWindow( bCheck );
|
||||
}
|
||||
|
||||
void CMakeRefusalListDlg::OnClose()
|
||||
{
|
||||
CDialog::OnClose();
|
||||
}
|
||||
|
||||
void CMakeRefusalListDlg::OnCancel()
|
||||
{
|
||||
CWnd* pWnd = (CWnd*)GetDlgItem( IDC_RUN_BTN );
|
||||
DWORD dwStyle = pWnd->GetStyle();
|
||||
if( dwStyle & WS_DISABLED )
|
||||
{
|
||||
CString str;
|
||||
str.Format( "작업이 진행중입니다.\n프로그램을 종료하시겠습니까?" );
|
||||
int nID = MessageBox( str, "프로그램 종료 질문", MB_ICONQUESTION|MB_YESNO );
|
||||
if( nID == IDNO )
|
||||
return;
|
||||
}
|
||||
|
||||
UpdateData();
|
||||
|
||||
g_AppConfig.bUsingAmount = ((CButton*)GetDlgItem( IDC_USING_AMOUNT_CHECK ))->GetCheck();
|
||||
g_AppConfig.bUsingBM = ((CButton*)GetDlgItem( IDC_USING_BM_CHECK ))->GetCheck();
|
||||
g_AppConfig.bUsingKosdaq = ((CButton*)GetDlgItem( IDC_USING_KOSDAQ_CHECK ))->GetCheck();
|
||||
g_AppConfig.bUsingExchange = ((CButton*)GetDlgItem( IDC_USING_EXCHANGE_CHECK ))->GetCheck();
|
||||
|
||||
g_AppConfig.nAmount = m_nAmount;
|
||||
g_AppConfig.nBM = m_nBM;
|
||||
|
||||
CDialog::OnCancel();
|
||||
}
|
||||
|
||||
void CMakeRefusalListDlg::OnRunBtn()
|
||||
{
|
||||
UpdateData();
|
||||
|
||||
CFile * pFile=NULL;
|
||||
HANDLE hFile;
|
||||
CString _strFileName;
|
||||
TCHAR szFilePath[_MAX_PATH]={0,};
|
||||
CStatic *pStatus = (CStatic*)GetDlgItem( IDC_PROGRESS_STATIC );
|
||||
|
||||
int nTotal=0;
|
||||
long nAmount, nBM=0;
|
||||
BOOL bCheck_AM;
|
||||
BOOL bCheck_BM;
|
||||
BOOL bCheck_KO;
|
||||
BOOL bCheck_EX;
|
||||
|
||||
CString str;
|
||||
str.Format( "거부리스트 검사는 몇분이 소요됩니다.\n"
|
||||
"이 작업은 옵션적용이 되므로, 옵션설정이 맞는지 확인하세요.\n"
|
||||
"작업을 계속 진행하시겠습니까?" );
|
||||
int nID = MessageBox( str, "거부리스트 진행", MB_ICONQUESTION|MB_YESNO );
|
||||
if( nID == IDNO )
|
||||
goto _EXIT1_;
|
||||
|
||||
((CWnd*)GetDlgItem( IDC_RUN_BTN ))->EnableWindow(FALSE);
|
||||
|
||||
///////////////////////////////////////////////////////////////////
|
||||
::GetModuleFileName(NULL, szFilePath, _MAX_PATH);
|
||||
*(strrchr( szFilePath, '\\' ) + 1) = 0;
|
||||
_strFileName.Format( "%s%s", szFilePath, m_strOutputFileName );
|
||||
hFile = CreateFile(_strFileName,
|
||||
GENERIC_WRITE, FILE_SHARE_READ,
|
||||
NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
|
||||
if (hFile == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
AfxMessageBox( _strFileName + " 파일을 만들 수 없습니다." );
|
||||
goto _EXIT1_;
|
||||
}
|
||||
else
|
||||
{
|
||||
pFile = new CFile(hFile);
|
||||
pFile->SeekToEnd();
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////
|
||||
bCheck_AM = ((CButton*)GetDlgItem( IDC_USING_AMOUNT_CHECK ))->GetCheck();
|
||||
bCheck_BM = ((CButton*)GetDlgItem( IDC_USING_BM_CHECK ))->GetCheck();
|
||||
bCheck_KO = ((CButton*)GetDlgItem( IDC_USING_KOSDAQ_CHECK ))->GetCheck();
|
||||
bCheck_EX = ((CButton*)GetDlgItem( IDC_USING_EXCHANGE_CHECK ))->GetCheck();
|
||||
|
||||
if( bCheck_AM )
|
||||
nAmount = m_nAmount;
|
||||
if( bCheck_BM )
|
||||
nBM = m_nBM;
|
||||
|
||||
if( (bCheck_AM == FALSE) && (bCheck_BM == FALSE) )
|
||||
{
|
||||
AfxMessageBox("거래량/거래금액 모두를 적용하지 않았습니다.\n\n적어도 하나는 지정하셔야 합니다.");
|
||||
goto _EXIT1_;
|
||||
}
|
||||
if( (bCheck_KO == FALSE) && (bCheck_EX == FALSE) )
|
||||
{
|
||||
AfxMessageBox("코스닥/거래소 모두를 적용하지 않았습니다.\n\n적어도 하나는 지정하셔야 합니다.");
|
||||
goto _EXIT1_;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
long nCount;
|
||||
HRESULT hr;
|
||||
ICpStockCodePtr _objStockCode;
|
||||
IDibPtr _objStockMst2;
|
||||
CString strMsg;
|
||||
|
||||
pStatus->SetWindowText( "초기화 검사중..." );
|
||||
|
||||
hr = _objStockCode.CreateInstance( CLSID_CpStockCode ); // 종목코드변환.
|
||||
if (SUCCEEDED(hr))
|
||||
hr = _objStockMst2.CreateInstance( CLSID_StockMst2 ); // 주식 복수 종목에 대해 일괄 조회를 요청하고 수신한다
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
char szFormat[256]={0,};
|
||||
wsprintf( szFormat, "' -------------------------------------------------------------------------- \r\n" );
|
||||
pFile->Write(szFormat, strlen(szFormat));
|
||||
|
||||
char szDate[100], szTime[100];
|
||||
_strdate( szDate ); _strtime( szTime );
|
||||
wsprintf( szFormat, "' 거부종목 검사일시 : %s : %s \r\n", szDate, szTime );
|
||||
pFile->Write(szFormat, strlen(szFormat));
|
||||
wsprintf( szFormat, "' 거부종목 검사설정 : 거래량(%s):%d주, 거래금액(%s):%d천원, 코스닥(%s), 거래소(%s) \r\n",
|
||||
bCheck_AM?"O":"X", m_nAmount, bCheck_BM?"O":"X", m_nBM, bCheck_KO?"O":"X", bCheck_EX?"O":"X" );
|
||||
pFile->Write(szFormat, strlen(szFormat));
|
||||
wsprintf( szFormat, "' 종목코드, 종목명, 구분, 거래량, 거래금액(천원) \r\n");
|
||||
pFile->Write(szFormat, strlen(szFormat));
|
||||
|
||||
wsprintf( szFormat, "' -------------------------------------------------------------------------- \r\n");
|
||||
pFile->Write(szFormat, strlen(szFormat));
|
||||
nCount = _objStockCode->GetCount();
|
||||
|
||||
CString _strJCode;
|
||||
|
||||
pStatus->SetWindowText( "전종목 코드 검사중..." );
|
||||
//for(int _j=0; _j<nCount; _j++)
|
||||
//{
|
||||
// _strJCode = (LPCSTR)(_bstr_t)_objStockCode->GetData(0, _j);
|
||||
// long nIndex = atol( (LPSTR)(LPCTSTR)_strJCode.Right(6) );
|
||||
|
||||
// // 1-장내, 5-코스닥, 6-제3시장
|
||||
// TypeGuBun[ nIndex ] = (short)_objStockCode->GetData( 4, _j );
|
||||
//}
|
||||
|
||||
m_hRunProgress.SetRange(0, (short)nCount);
|
||||
m_hRunProgress.SetPos(0);
|
||||
|
||||
short j=0;
|
||||
|
||||
while( j<nCount )
|
||||
{
|
||||
long i=0;
|
||||
char szCode[1024]={0,};
|
||||
for(; (j<nCount)&&(i<100); j++, i++)
|
||||
{
|
||||
// 1-장내, 5-코스닥, 6-제3시장
|
||||
short type = _objStockCode->GetData( 4, j );
|
||||
CString strCode = (LPSTR)(_bstr_t)_objStockCode->GetData(0, j);
|
||||
|
||||
strcat( szCode, (LPSTR)(LPCTSTR)strCode );
|
||||
strcat( szCode, "," );
|
||||
}
|
||||
|
||||
if( strlen( szCode ) == 0 )
|
||||
continue;
|
||||
*(strrchr( szCode, ',' )) = NULL;
|
||||
|
||||
_objStockMst2->SetInputValue( 0, szCode );
|
||||
_objStockMst2->BlockRequest();
|
||||
|
||||
strMsg.Format( "%d/%d 진행중", j, nCount );
|
||||
pStatus->SetWindowText( strMsg );
|
||||
|
||||
short nRecv = (short)_objStockMst2->GetHeaderValue(0);
|
||||
if( nRecv == 0 )
|
||||
{
|
||||
AfxMessageBox("수신된 데이터가 없습니다. Cybosplus 서비스 시간대를 확인해주세요.");
|
||||
break;
|
||||
}
|
||||
|
||||
for( long k=0; k<nRecv; k++ )
|
||||
{
|
||||
long nAmount_Current = (long)_objStockMst2->GetDataValue(11, k); // 11 : (unsigned long) 거래량
|
||||
long nBM_Current = (long)_objStockMst2->GetDataValue(12, k); // 12 : (long) 거래대금(단위, 거래소:만원, 코스닥:천원)
|
||||
|
||||
CString strJCode = (LPSTR)(_bstr_t)_objStockMst2->GetDataValue(0, k); // 0 : (string) 종목 코드
|
||||
long nIndex = atol( (LPSTR)(LPCTSTR)strJCode.Right(6) );
|
||||
|
||||
if(strJCode == "A000220")
|
||||
{
|
||||
TRACE("test");
|
||||
}
|
||||
|
||||
//// 단위를 (천원)단위로 재계산.
|
||||
// // 1-장내, 5-코스닥, 6-제3시장
|
||||
//if( (TypeGuBun[nIndex]==1) && bCheck_EX)
|
||||
// nBM_Current = nBM_Current * 10;
|
||||
//else if( (TypeGuBun[ nIndex ]==5) && bCheck_KO)
|
||||
// nBM_Current = nBM_Current * 1;
|
||||
//else
|
||||
// continue;
|
||||
|
||||
if( ((nAmount_Current <= nAmount) && bCheck_AM) ||
|
||||
((nBM_Current <= nBM) && bCheck_BM) )
|
||||
{
|
||||
char szFormat[256]={0,};
|
||||
wsprintf( szFormat, "%6s, %20s, [%d], %10d, %12d \r\n",
|
||||
(LPSTR)(LPCTSTR)strJCode.Right(6),
|
||||
(LPSTR)(LPCTSTR)(_bstr_t)_objStockMst2->GetDataValue(1, k),
|
||||
0,
|
||||
nAmount_Current, nBM_Current );
|
||||
pFile->Write(szFormat, strlen(szFormat));
|
||||
|
||||
++nTotal;
|
||||
}
|
||||
else
|
||||
{
|
||||
TRACE("조건보다 큼");
|
||||
}
|
||||
}
|
||||
|
||||
m_hRunProgress.SetPos(j);
|
||||
}
|
||||
}
|
||||
|
||||
_objStockCode.Release();
|
||||
_objStockMst2.Release();
|
||||
|
||||
strMsg.Format( "거부리스트 검사: %d종목.", nTotal );
|
||||
pStatus->SetWindowText( strMsg );
|
||||
AfxMessageBox( strMsg );
|
||||
}
|
||||
catch( _com_error e )
|
||||
{
|
||||
AfxMessageBox( "프로그램을 실행 할 수 없습니다!" );
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
AfxMessageBox( "프로그램실행중 문제가 발생하였습니다." );
|
||||
}
|
||||
|
||||
_EXIT1_:
|
||||
if( pFile )
|
||||
{
|
||||
pFile->Close();
|
||||
SAFE_DELETE( pFile );
|
||||
}
|
||||
|
||||
((CWnd*)GetDlgItem( IDC_RUN_BTN ))->EnableWindow(TRUE);
|
||||
}
|
||||
/*
|
||||
void CMakeRefusalListDlg::OnManageCodeBtn()
|
||||
{
|
||||
UpdateData();
|
||||
|
||||
CFile * pFile=NULL;
|
||||
HANDLE hFile;
|
||||
CString _strFileName;
|
||||
TCHAR szFilePath[_MAX_PATH]={0,};
|
||||
CStatic *pStatus = (CStatic*)GetDlgItem( IDC_PROGRESS_STATIC );
|
||||
|
||||
CString str;
|
||||
str.Format( "전종목 관리/감독 종목검사는 최소30분이 소요됩니다.\n"
|
||||
"이 작업은 옵션적용이 없습니다.\n"
|
||||
"'관리감독종목.txt'파일을 생성합니다.\n"
|
||||
"작업을 계속 진행하시겠습니까?" );
|
||||
int nID = MessageBox( str, "관리/감독 종목검사 진행", MB_ICONQUESTION|MB_YESNO );
|
||||
if( nID == IDNO )
|
||||
goto _EXIT2_;
|
||||
|
||||
((CWnd*)GetDlgItem( IDC_RUN_BTN ))->EnableWindow(FALSE);
|
||||
((CWnd*)GetDlgItem( IDC_MANAGE_CODE_BTN ))->EnableWindow(FALSE);
|
||||
|
||||
///////////////////////////////////////////////////////////////////
|
||||
::GetModuleFileName(NULL, szFilePath, _MAX_PATH);
|
||||
*(strrchr( szFilePath, '\\' ) + 1) = 0;
|
||||
_strFileName.Format( "%s관리감독종목.txt", szFilePath );
|
||||
hFile = CreateFile(_strFileName,
|
||||
GENERIC_WRITE, FILE_SHARE_READ,
|
||||
NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
if (hFile == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
AfxMessageBox(_T("'관리감독종목.txt' 파일을 만들 수 없습니다."));
|
||||
goto _EXIT2_;
|
||||
}
|
||||
else
|
||||
{
|
||||
pFile = new CFile((int)hFile);
|
||||
pFile->SeekToEnd();
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////
|
||||
try
|
||||
{
|
||||
long nCount;
|
||||
HRESULT hr;
|
||||
ICpStockCodePtr _objStockCode;
|
||||
IDibPtr _objStockMst;
|
||||
|
||||
CString strMsg;
|
||||
pStatus->SetWindowText( "최기화 검사중..." );
|
||||
|
||||
long nTotal=0;
|
||||
hr = _objStockCode.CreateInstance( CLSID_CpStockCode ); // 종목코드변환.
|
||||
if (SUCCEEDED(hr))
|
||||
hr = _objStockMst.CreateInstance( CLSID_StockMst ); // 주식 종목에 대해 현재가에 관련된 모든 정보를 한 눈에 볼 수 있게
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
CString _strJCode;
|
||||
nCount = _objStockCode->GetCount();
|
||||
|
||||
m_hRunProgress.SetRange(0, (short)nCount);
|
||||
m_hRunProgress.SetPos(0);
|
||||
|
||||
for(int _j=0; _j<nCount; _j++)
|
||||
{
|
||||
_strJCode = (LPCSTR)(_bstr_t)_objStockCode->GetData(0, _j); // 종목코드.
|
||||
|
||||
// 1-장내, 5-코스닥, 6-제3시장
|
||||
short sType = (short)_objStockCode->GetData( 4, _j );
|
||||
if( sType == 1 || sType == 5 )
|
||||
{
|
||||
_objStockMst->SetInputValue(0,(LPSTR)(LPCTSTR)_strJCode);
|
||||
_objStockMst->BlockRequest();
|
||||
BYTE cbCodeGubun = _objStockMst->GetHeaderValue(44);
|
||||
if( cbCodeGubun != '0' ) // 0: 정상, 1: 감리, 2: 관리, 3: 거래정지, ...
|
||||
{
|
||||
CString _strJName = (LPCSTR)(_bstr_t)_objStockCode->GetData(1, _j); // 종목명.
|
||||
|
||||
char szFormat[256]={0,};
|
||||
wsprintf( szFormat, "%5s,%C, %20s \r\n",
|
||||
(LPSTR)(LPCTSTR)_strJCode.Right(5), cbCodeGubun, (LPSTR)(LPCTSTR)_strJName );
|
||||
pFile->Write(szFormat, strlen(szFormat));
|
||||
|
||||
++nTotal;
|
||||
}
|
||||
}
|
||||
|
||||
m_hRunProgress.SetPos(_j);
|
||||
|
||||
strMsg.Format( "%d/%d 진행중", _j, nCount );
|
||||
pStatus->SetWindowText( strMsg );
|
||||
}
|
||||
}
|
||||
|
||||
_objStockCode.Release();
|
||||
_objStockMst.Release();
|
||||
|
||||
strMsg.Format( "관리감독종목 검사: %d종목.", nTotal );
|
||||
pStatus->SetWindowText( strMsg );
|
||||
AfxMessageBox( strMsg );
|
||||
}
|
||||
catch( _com_error e )
|
||||
{
|
||||
AfxMessageBox( "프로그램을 실행 할 수 없습니다!" );
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
AfxMessageBox( "프로그램실행중 문제가 발생하였습니다." );
|
||||
}
|
||||
|
||||
_EXIT2_:
|
||||
if( pFile )
|
||||
{
|
||||
pFile->Close();
|
||||
SAFE_DELETE( pFile );
|
||||
}
|
||||
|
||||
((CWnd*)GetDlgItem( IDC_RUN_BTN ))->EnableWindow(TRUE);
|
||||
((CWnd*)GetDlgItem( IDC_MANAGE_CODE_BTN ))->EnableWindow(TRUE);
|
||||
}
|
||||
*/
|
||||
57
MakeRefusalList/MakeRefusalListDlg.h
Normal file
57
MakeRefusalList/MakeRefusalListDlg.h
Normal file
@@ -0,0 +1,57 @@
|
||||
// MakeRefusalListDlg.h : header file
|
||||
//
|
||||
|
||||
#if !defined(AFX_MAKEREFUSALLISTDLG_H__6FF3141C_F49D_44D6_AB79_118AD467E683__INCLUDED_)
|
||||
#define AFX_MAKEREFUSALLISTDLG_H__6FF3141C_F49D_44D6_AB79_118AD467E683__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CMakeRefusalListDlg dialog
|
||||
|
||||
class CMakeRefusalListDlg : public CDialog
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
CMakeRefusalListDlg(CWnd* pParent = NULL); // standard constructor
|
||||
|
||||
// Dialog Data
|
||||
//{{AFX_DATA(CMakeRefusalListDlg)
|
||||
enum { IDD = IDD_MAKEREFUSALLIST_DIALOG };
|
||||
CProgressCtrl m_hRunProgress;
|
||||
long m_nAmount;
|
||||
long m_nBM;
|
||||
CString m_strOutputFileName;
|
||||
//}}AFX_DATA
|
||||
|
||||
// ClassWizard generated virtual function overrides
|
||||
//{{AFX_VIRTUAL(CMakeRefusalListDlg)
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
//}}AFX_VIRTUAL
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
HICON m_hIcon;
|
||||
|
||||
// Generated message map functions
|
||||
//{{AFX_MSG(CMakeRefusalListDlg)
|
||||
virtual BOOL OnInitDialog();
|
||||
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
|
||||
afx_msg void OnPaint();
|
||||
afx_msg HCURSOR OnQueryDragIcon();
|
||||
virtual void OnCancel();
|
||||
afx_msg void OnUsingAmountCheck();
|
||||
afx_msg void OnUsingBmCheck();
|
||||
afx_msg void OnClose();
|
||||
afx_msg void OnRunBtn();
|
||||
//}}AFX_MSG
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_MAKEREFUSALLISTDLG_H__6FF3141C_F49D_44D6_AB79_118AD467E683__INCLUDED_)
|
||||
8
MakeRefusalList/StdAfx.cpp
Normal file
8
MakeRefusalList/StdAfx.cpp
Normal file
@@ -0,0 +1,8 @@
|
||||
// stdafx.cpp : source file that includes just the standard includes
|
||||
// MakeRefusalList.pch will be the pre-compiled header
|
||||
// stdafx.obj will contain the pre-compiled type information
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
|
||||
APP_CONFIG g_AppConfig = { TRUE, TRUE, TRUE, TRUE, 1000, 10000 };
|
||||
48
MakeRefusalList/StdAfx.h
Normal file
48
MakeRefusalList/StdAfx.h
Normal file
@@ -0,0 +1,48 @@
|
||||
// stdafx.h : include file for standard system include files,
|
||||
// or project specific include files that are used frequently, but
|
||||
// are changed infrequently
|
||||
//
|
||||
|
||||
#if !defined(AFX_STDAFX_H__639EF927_3D4E_41F2_92FD_BFFCFF4FB440__INCLUDED_)
|
||||
#define AFX_STDAFX_H__639EF927_3D4E_41F2_92FD_BFFCFF4FB440__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
|
||||
|
||||
#include <afxwin.h> // MFC core and standard components
|
||||
#include <afxext.h> // MFC extensions
|
||||
#include <afxdisp.h> // MFC Automation classes
|
||||
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
|
||||
#ifndef _AFX_NO_AFXCMN_SUPPORT
|
||||
#include <afxcmn.h> // MFC support for Windows Common Controls
|
||||
#endif // _AFX_NO_AFXCMN_SUPPORT
|
||||
|
||||
#include <comdef.h>
|
||||
#include <afxpriv.h> // T2A macros
|
||||
// Ãß°¡
|
||||
#import "c:\daishin\CYBOSPLUS\cpdib.dll" no_namespace named_guids
|
||||
//#import "c:\daishin\CYBOSPLUS\cptrade.dll" no_namespace named_guids
|
||||
#import "c:\daishin\CYBOSPLUS\cputil.dll" no_namespace named_guids
|
||||
|
||||
#define SAFE_DELETE(pObject) { if (pObject) {delete pObject; pObject = NULL; }; }
|
||||
|
||||
|
||||
typedef struct _tag_APP_CONFIG
|
||||
{
|
||||
BOOL bUsingAmount;
|
||||
BOOL bUsingBM;
|
||||
BOOL bUsingExchange;
|
||||
BOOL bUsingKosdaq;
|
||||
|
||||
int nAmount;
|
||||
int nBM;
|
||||
} APP_CONFIG;
|
||||
extern APP_CONFIG g_AppConfig;
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_STDAFX_H__639EF927_3D4E_41F2_92FD_BFFCFF4FB440__INCLUDED_)
|
||||
BIN
MakeRefusalList/res/MakeRefusalList.ico
Normal file
BIN
MakeRefusalList/res/MakeRefusalList.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
13
MakeRefusalList/res/MakeRefusalList.rc2
Normal file
13
MakeRefusalList/res/MakeRefusalList.rc2
Normal file
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// MAKEREFUSALLIST.RC2 - resources Microsoft Visual C++ does not edit directly
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#error this file is not editable by Microsoft Visual C++
|
||||
#endif //APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Add manually edited resources here...
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
30
MakeRefusalList/resource.h
Normal file
30
MakeRefusalList/resource.h
Normal file
@@ -0,0 +1,30 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Developer Studio generated include file.
|
||||
// Used by MakeRefusalList.rc
|
||||
//
|
||||
#define IDM_ABOUTBOX 0x0010
|
||||
#define IDD_ABOUTBOX 100
|
||||
#define IDS_ABOUTBOX 101
|
||||
#define IDD_MAKEREFUSALLIST_DIALOG 102
|
||||
#define IDR_MAINFRAME 128
|
||||
#define IDC_USING_AMOUNT_CHECK 1000
|
||||
#define IDC_USING_BM_CHECK 1001
|
||||
#define IDC_AMOUNT_EDIT 1002
|
||||
#define IDC_BM_EDIT 1003
|
||||
#define IDC_USING_KOSDAQ_CHECK 1004
|
||||
#define IDC_USING_EXCHANGE_CHECK 1005
|
||||
#define IDC_OUTPUTFILENAME_EDIT 1006
|
||||
#define IDC_RUN_PROGRESS 1007
|
||||
#define IDC_RUN_BTN 1008
|
||||
#define IDC_PROGRESS_STATIC 1009
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 129
|
||||
#define _APS_NEXT_COMMAND_VALUE 32771
|
||||
#define _APS_NEXT_CONTROL_VALUE 1011
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
||||
Reference in New Issue
Block a user