?? smssend.cpp
字號:
// SMSSend.cpp : Defines the class behaviors for the application.
//
#include "stdafx.h"
#include "SMSSend.h"
#include "SMSSendDlg.h"
#include "SettingsDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
CString m_strPort;
CString m_strRate;
CString m_strSmsc;
char system_file[200];
char message_file[200];
char receive_file[200];
BOOL m_hand=0;
/////////////////////////////////////////////////////////////////////////////
// CSMSSendApp
BEGIN_MESSAGE_MAP(CSMSSendApp, CWinApp)
//{{AFX_MSG_MAP(CSMSSendApp)
// 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()
/////////////////////////////////////////////////////////////////////////////
// CSMSSendApp construction
CSMSSendApp::CSMSSendApp()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CSMSSendApp object
CSMSSendApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CSMSSendApp initialization
BOOL CSMSSendApp::InitInstance()
{
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
GetModuleFileName(NULL,system_file,200);
int l=strlen(system_file);
for(int i=l;i>0;i--)
{
if(system_file[i-1]=='\\')
{
system_file[i-1]=0;
break;
}
}
strcpy(message_file,system_file);
strcat(message_file,"\\message.txt");
strcpy(receive_file,system_file);
strcat(receive_file,"\\receive.txt");
strcat(system_file,"\\system.dat");
CFile fp;
char str[10];
if(fp.Open(system_file,fp.modeRead|fp.typeBinary))
{
int i;
for(i=0;i<10;i++)
str[i]=0;
if(fp.Read(str,4)==4)
{
str[4]=0;
m_strPort=str;
fp.Read(str,6);
for(i=0;i<10;i++)
if(str[i]<'0'||str[i]>'9') str[i]=0;
m_strRate=str;
}
fp.Close();
}
else
{
if(fp.Open(system_file,fp.modeWrite|fp.modeCreate|fp.typeBinary))
{
m_strPort="COM1";
m_strRate="9600";
fp.Write(m_strPort,4);
fp.Write(m_strRate,4);
fp.Close();
}
}
m_strSmsc="13800417500";
// return FALSE;
CSMSSendDlg 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;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -