⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 maindlg.cpp

📁 类似于股市K线技术分析的系统源码
💻 CPP
字号:
// MainDlg.cpp : implementation file
//

#include "stdafx.h"
#include "lastproject.h"
#include "MainDlg.h"

#include "Records.h"
#include "ChartMA.h"
#include "ChartRSI.h"
#include "ChartKDJ.h"
#include "ChartMACD.h"

//#define SHOWNEXTCHART1 180

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CMainDlg dialog

UINT ThreadProc1(LPVOID param)
{
	Sleep(50);
	CMainDlg * pdlg = (CMainDlg *)param;
	pdlg->m_DirectFace.DrawFrame();
	if(atoi(__argv[1])==1) pdlg->SetTimer(1,1000,NULL);
	return 0;
}

CMainDlg::CMainDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CMainDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CMainDlg)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void CMainDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CMainDlg)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CMainDlg, CDialog)
	//{{AFX_MSG_MAP(CMainDlg)
	ON_WM_TIMER()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CMainDlg message handlers

BOOL CMainDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	SetIcon(m_hIcon, TRUE);			// Set big icon
	SetIcon(m_hIcon, FALSE);		// Set small icon
	
	//Set Main Window possition 
	ReMoveWindow(m_WindowRect);
	MoveWindow(m_WindowRect);
	::SetWindowPos(AfxGetMainWnd()->m_hWnd,HWND_TOPMOST,0,0,m_WindowRect.Width(),m_WindowRect.Height(),SWP_NOMOVE|SWP_NOSIZE);	
	if(m_DirectFace.Create(m_hWnd,m_WindowRect)) AfxBeginThread(ThreadProc1,this);
		else return FALSE;
	return TRUE;

}

void CMainDlg::OnTimer(UINT nIDEvent) 
{
	// TODO: Add your message handler code here and/or call default
	KillTimer(1);
	ShowNextChart1();//::PostMessage(HWND_BROADCAST,SHOWNEXTCHART1,NULL,NULL);
	CDialog::OnTimer(nIDEvent);	
}

/*void CMainDlg::OnShowNextChart1()
{
	SShowInfo showinfo = m_schedual.GetNextShowInfo();
	CRecords records(showinfo.TableName,showinfo.ExCode);
	if(showinfo.ChartType == "MA")
	{
		CChartMA ma(&records,&m_DirectFace,showinfo.Param[0],showinfo.Param[1],showinfo.Param[2]);
	}
	if(showinfo.ChartType == "RSI")
	{
		CChartRSI rsi(&records,&m_DirectFace,showinfo.Param[0],showinfo.Param[1],showinfo.Param[2]);
	}
	if(showinfo.ChartType == "KDJ")
	{
		CChartKDJ kdj(&records,&m_DirectFace,showinfo.Param[0],showinfo.Param[1],showinfo.Param[2]);
	}
	if(showinfo.ChartType == "MACD")
	{
		CChartMACD macd(&records,&m_DirectFace,showinfo.Param[0],showinfo.Param[1],showinfo.Param[2]);
	}
	if(atoi(__argv[1])==1) SetTimer(1,showinfo.DelaySeconds*1000,NULL);
}*/

void CMainDlg::ShowNextChart1()
{
	SShowInfo showinfo = m_schedual.GetNextShowInfo();
	CRecords records(showinfo.TableName,showinfo.ExCode);
	if(showinfo.ChartType == "MA")
	{
		CChartMA ma(&records,&m_DirectFace,showinfo.Param[0],showinfo.Param[1],showinfo.Param[2]);
	}
	if(showinfo.ChartType == "RSI")
	{
		CChartRSI rsi(&records,&m_DirectFace,showinfo.Param[0],showinfo.Param[1],showinfo.Param[2]);
	}
	if(showinfo.ChartType == "KDJ")
	{
		CChartKDJ kdj(&records,&m_DirectFace,showinfo.Param[0],showinfo.Param[1],showinfo.Param[2]);
	}
	if(showinfo.ChartType == "MACD")
	{
		CChartMACD macd(&records,&m_DirectFace,showinfo.Param[0],showinfo.Param[1],showinfo.Param[2]);
	}
	if(atoi(__argv[1])==1) SetTimer(1,showinfo.DelaySeconds*1000,NULL);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -