sjshq.cpp

来自「一个通过PCI卡向LED屏发送股票实时行情的系统」· C++ 代码 · 共 138 行

CPP
138
字号
// sjshq.cpp : Defines the class behaviors for the application.
//

#include "stdafx.h"
#include "sjshq.h"
#include "sjshqDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// CSjshqApp

BEGIN_MESSAGE_MAP(CSjshqApp, CWinApp)
	//{{AFX_MSG_MAP(CSjshqApp)
		// 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()

/////////////////////////////////////////////////////////////////////////////
// CSjshqApp construction

CSjshqApp::CSjshqApp()
{
	// TODO: add construction code here,
	// Place all significant initialization in InitInstance
}

/////////////////////////////////////////////////////////////////////////////
// The one and only CSjshqApp object

CSjshqApp theApp;

/////////////////////////////////////////////////////////////////////////////
// CSjshqApp initialization

BOOL CSjshqApp::InitInstance()
{
	AfxEnableControlContainer();
	AfxOleInit();

	// 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
	GetSystemConfig();
	CSjshqDlg 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;
}
void CSjshqApp::GetSystemConfig()
{
	static  char    *szProFile="C:\\WINDOWS\\sjshq.ini";
	char    cTemp[10],temp[200];
	CString str,tempstr;
	int index;
	//自动运行时间
	GetPrivateProfileString("AUTO_TIME","Time1","",temp,sizeof(temp),szProFile);
	Time1=temp;
	GetPrivateProfileString("AUTO_TIME","Time2","",temp,sizeof(temp),szProFile);
	Time2=temp;
	GetPrivateProfileString("AUTO_TIME","Time3","",temp,sizeof(temp),szProFile);
	Time3=temp;
	GetPrivateProfileString("AUTO_TIME","Time4","",temp,sizeof(temp),szProFile);
	Time4=temp;
	GetPrivateProfileString("AUTO_TIME","Time5","",temp,sizeof(temp),szProFile);
	Time5=temp;

	strcpy(cTemp, "Bmp");
	for (int i=0;i<MAX_FILENUMBER;i++)
	{
		itoa(i+1,&cTemp[3],10);
		GetPrivateProfileString("ZM_BMPFILE",cTemp,"0,6",temp,
								sizeof(temp),szProFile);
		str=temp;
		if(str.IsEmpty())	str="0,6";
		index=str.Find(",");
		if(index!=-1)
		{
			ZM_bmpFile[i].DisplayMode=atoi(str.Left(index));
			ZM_bmpFile[i].PauseTime=atoi(str.Right(str.GetLength()-index-1));
		}
		else
		{
			ZM_bmpFile[i].DisplayMode=0;
			ZM_bmpFile[i].PauseTime=6;
		}

	}
	GetPrivateProfileString("ZM_TXTFILE","Txt1","",temp,sizeof(temp),szProFile);
	ZM_txt1File=temp;
	GetPrivateProfileString("ZM_TXTFILE","Txt2","",temp,sizeof(temp),szProFile);
	ZM_txt2File=temp;
	GetPrivateProfileString("ZM_TXTFILE","Txt3","",temp,sizeof(temp),szProFile);
	ZM_txt3File=temp;
	GetPrivateProfileString("ZM_TXTFILE","Txt4","",temp,sizeof(temp),szProFile);
	ZM_txt4File=temp;
	GetPrivateProfileString("ZM_TXTFILE","Txt_0812","",temp,sizeof(temp),szProFile);////20020812记帐式(  期)国债
	Txt_0812=temp;

	TxtPauseTime = GetPrivateProfileInt("ZM_TXTFILE", "TxtPauseTime", 30, szProFile);

	LED_Top = GetPrivateProfileInt("PalyFile_Parameter", "LED_Left", 0, szProFile);
	LED_Left = GetPrivateProfileInt("PalyFile_Parameter", "LED_Top", 0, szProFile);
	LED_W = GetPrivateProfileInt("PalyFile_Parameter", "LED_W", 1024,szProFile);
	LED_H = GetPrivateProfileInt("PalyFile_Parameter", "LED_H", 704, szProFile);
	
	GetPrivateProfileString("PalyFile_Parameter","ZST1_File","",temp,sizeof(temp),szProFile);
	ZST1_File=temp;
	GetPrivateProfileString("PalyFile_Parameter","ZST2_File","",temp,sizeof(temp),szProFile);
	ZST2_File=temp;
//	LED_UpRollSpeed=GetPrivateProfileInt("PalyFile_Parameter", "LED_UpRollSpeed", 1, szProFile);
}

⌨️ 快捷键说明

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