?? appstatic.cpp
字號(hào):
// APPStatic.cpp: implementation of the APPStatic class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "RADIO.h"
#include "APPStatic.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
double APPStatic::app_dMagneticErrorAngle=2.0;//磁偏角(磁北相對(duì)于真北,順時(shí)針為正)
LONG APPStatic::app_lTimeEllapse=100;//仿真時(shí)間步長(zhǎng)ms,就是定時(shí)器的timeellapse
double APPStatic::app_dSimuTime=0.0;//仿真時(shí)間static,就是航跡的真實(shí)時(shí)間
CSize APPStatic::app_sizeSheet1=CSize(1010,780);//Sheet1的大小
CSize APPStatic::app_sizeSheet2=CSize(1024,650);//Sheet2的大小
COLORREF APPStatic::colorDlg=RGB(0,39,79);//對(duì)話框背景色
CString APPStatic::strStopSimu="停止運(yùn)行";//停止仿真時(shí)工具條字符串
CString APPStatic::strOnSimu="正在運(yùn)行";//正在仿真時(shí)工具條字符串
CString APPStatic::strWndTitle="無線電導(dǎo)航指示器";//大標(biāo)題
int APPStatic::nFirstSheet=0;//初始顯示的tab
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
APPStatic::APPStatic()
{
}
APPStatic::~APPStatic()
{
}
CString APPStatic::Time2String(double dTime){
//時(shí)間(s)轉(zhuǎn)成字符串
CString strTime;
double dHr=(double)(LONG)(dTime/3600);
double dMi=(double)(LONG)((dTime-dHr*3600)/60);
double dSec=dTime-dHr*3600-dMi*60;
strTime.Format("%2ld:%2ld:%6.3lf",(LONG)dHr,(LONG)dMi,dSec);
return strTime;
}
void APPStatic::GetDoubleColor(COLORREF rgb,double* pdColor){
double r=(double)GetRValue(rgb);
double g=(double)GetGValue(rgb);
double b=(double)GetBValue(rgb);
pdColor[0]=r/255.0;
pdColor[1]=g/255.0;
pdColor[2]=b/255.0;
}
CRADIOView* APPStatic::GetMainView()
{
return (CRADIOView*)(((CFrameWnd*)(AfxGetApp()->m_pMainWnd))->GetActiveView());
}
BOOL APPStatic::RegisterActivex(LPCSTR szActivexFileName)
{
//裝載ActiveX控件
HINSTANCE hLib = LoadLibrary(szActivexFileName);
if (hLib < (HINSTANCE)HINSTANCE_ERROR)
{
::MessageBox(NULL,TEXT("不能載入ActiveX文件!"),TEXT("結(jié)果"),MB_OK);
return FALSE;
}
//獲取注冊(cè)函數(shù)DllRegisterServer地址
FARPROC lpDllEntryPoint;
lpDllEntryPoint = GetProcAddress(hLib,_T("DllRegisterServer"));
//調(diào)用注冊(cè)函數(shù)DllRegisterServer
if(lpDllEntryPoint!=NULL)
{
if(FAILED((*lpDllEntryPoint)()))
{
::MessageBox(NULL,TEXT("調(diào)用DllRegisterServer失敗!)"),TEXT("結(jié)果"),MB_OK);
::FreeLibrary(hLib);
return FALSE;
}
//::MessageBox(NULL,TEXT("注冊(cè)成功"),TEXT("結(jié)果"),MB_OK);
return TRUE;
}
else
{ ::MessageBox(NULL,TEXT("調(diào)用DllRegisterServer失敗!"),TEXT("結(jié)果"),MB_OK);
return FALSE;
}
}
BOOL APPStatic::UnRegisterActivex(LPCSTR szActivexFileName)
{
//裝載ActiveX控件
HINSTANCE hLib = LoadLibrary(szActivexFileName);
if (hLib < (HINSTANCE)HINSTANCE_ERROR)
{
::MessageBox(NULL,TEXT("不能載入ActiveX文件!"),TEXT("結(jié)果"),MB_OK);
return FALSE;
}
//獲取注冊(cè)函數(shù)DllRegisterServer地址
FARPROC lpDllEntryPoint;
lpDllEntryPoint = GetProcAddress(hLib,TEXT("DllUnregisterServer"));
//調(diào)用注冊(cè)函數(shù)DllRegisterServer
if(lpDllEntryPoint!=NULL)
{
if(FAILED((*lpDllEntryPoint)()))
{
::MessageBox(NULL,TEXT("調(diào)用DllUnRegisterServer失敗!)"),TEXT("結(jié)果"),MB_OK);
::FreeLibrary(hLib);
return FALSE;
}
//::MessageBox(NULL,TEXT("反注冊(cè)成功"),TEXT("結(jié)果"),MB_OK);
return TRUE;
}
else
::MessageBox(NULL,TEXT("調(diào)用DllUnRegisterServer失敗!"),TEXT("結(jié)果"),MB_OK);
return FALSE;
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -