国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學(xué)院 > 開發(fā)設(shè)計(jì) > 正文

MFC的Afx全局函數(shù)、其常宏、數(shù)據(jù)類型

2019-11-08 02:24:08
字體:
供稿:網(wǎng)友
一、Afx全局函數(shù)

  AfxBeginThread:開始一個(gè)新的線程

  AfxEndThread:結(jié)束一個(gè)舊的線程

  AfxFormatString1:類似PRintf一般地將字符串格式化

  AfxFormatString2:類似printf一般地將字符串格式化

  AfxMessageBox:類似Windows API 函數(shù) MessageBox

  AfxOuputDebugString:將字符串輸往除錯(cuò)裝置

  AfxGetApp:獲得application object (CWinApp派生對(duì)象)的指針

  AfxGetMainWnd:獲得程序主窗口的指針

  AfxGetInstance:獲得程序的instance handle

// global helpers for threadsCWinThread* AFXAPI AfxBeginThread(AFX_THREADPROC pfnThreadProc, LPVOID pParam,	int nPriority = THREAD_PRIORITY_NORMAL, UINT nStackSize = 0,	DWord dwCreateFlags = 0, LPSECURITY_ATTRIBUTES lpSecurityAttrs = NULL);
CWinThread* AFXAPI AfxBeginThread(CRuntimeClass* pThreadClass,	int nPriority = THREAD_PRIORITY_NORMAL, UINT nStackSize = 0,	DWORD dwCreateFlags = 0, LPSECURITY_ATTRIBUTES lpSecurityAttrs = NULL);CWinThread* AFXAPI AfxGetThread();MSG* AFXAPI AfxGetCurrentMessage();void AFXAPI AfxEndThread(UINT nExitCode, BOOL bDelete = TRUE);void AFXAPI AfxInitThread();void AFXAPI AfxTermThread(HINSTANCE hInstTerm = NULL);/*============================================================================*/// Global functions for access to the one and only CWinApp#define afxCurrentWinApp    AfxGetModuleState()->m_pCurrentWinApp#define afxCurrentInstanceHandle    AfxGetModuleState()->m_hCurrentInstanceHandle#define afxCurrentResourceHandle    AfxGetModuleState()->m_hCurrentResourceHandle#define afxCurrentAppName   AfxGetModuleState()->m_lpszCurrentAppName#define afxContextIsDLL     AfxGetModuleState()->m_bDLL#define afxRegisteredClasses    AfxGetModuleState()->m_fRegisteredClasses#define afxOccManager   AfxGetModuleState()->m_pOccManager// Advanced initialization: for overriding default WinMainBOOL AFXAPI AfxWinInit(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance,	_In_z_ LPTSTR lpCmdLine, _In_ int nCmdShow);void AFXAPI AfxWinTerm();// Global Windows state data helper functions (inlines)#ifdef _AFXDLLULONG AFXAPI AfxGetDllVersion();#endifCWinApp* AFXAPI AfxGetApp();CWnd* AFXAPI AfxGetMainWnd();HINSTANCE AFXAPI AfxGetInstanceHandle();HINSTANCE AFXAPI AfxGetResourceHandle();void AFXAPI AfxSetResourceHandle(HINSTANCE hInstResource);LPCTSTR AFXAPI AfxGetAppName();AFX_DEPRECATED("AfxLoadLangResourceDLL(LPCTSTR pszFormat) has been deprecated, use AfxLoadLangResourceDLL(LPCTSTR pszFormat, LPCTSTR pszPath) instead")	HINSTANCE AFXAPI AfxLoadLangResourceDLL(LPCTSTR pszFormat);HINSTANCE AFXAPI AfxLoadLangResourceDLL(LPCTSTR pszFormat, LPCTSTR pszPath);// Use instead of PostQuitMessage in OLE server applicationsvoid AFXAPI AfxPostQuitMessage(int nExitCode);// Use AfxFindResourceHandle to find resource in chain of extension DLLs#ifndef _AFXDLL#define AfxFindResourceHandle(lpszResource, lpszType) AfxGetResourceHandle()#elseHINSTANCE AFXAPI AfxFindResourceHandle(LPCTSTR lpszName, LPCTSTR lpszType);#endif/// <summary>/// Deletes the subkeys and values of the specified key recursively.</summary>/// <returns> /// If the function succeeds, the return value is ERROR_SUCCESS. If the function fails, the return value is a nonzero error code defined in Winerror.h</returns>/// <param name="hKey">A handle to an open registry key.</param>/// <param name="lpSubKey">The name of the key to be deleted.</param>/// <param name="pTM">Pointer to CAtlTransactionManager object</param>LONG AFXAPI AfxDelRegTreeHelper(HKEY hParentKey, const CString& strKeyName, CAtlTransactionManager* pTM = NULL);class CRecentFileList;          // forward reference (see afxadv.h)class CDataRecoveryHandler;     // forward reference (see afxdatarecovery.h)// access to message filter in CWinAppCOleMessageFilter* AFXAPI AfxOleGetMessageFilter();/*============================================================================*/// CCommandLineInfo

二. MFC提供的主要宏:

       消息映射宏: 聲明消息映射表 (將于3.2.2節(jié)介紹)宏DECLARE_MESSAGE_MAP、定義消息映射表宏BEGIN_MESSAGE_MAP和END_MESSAGE_MAP對(duì)、消息映射表入口宏ON_加消息名。

      動(dòng)態(tài) MFC對(duì)象宏: DECLARE_DYNCREATE和DECLARE_DYNAMIC, IMPLEMENT_DYNCREATE和MPLEMENT_DYNAMIC      運(yùn)行時(shí)類宏: RUNTIME_CLASS      序列化宏: DECLARE_SERIAL和IMPLEMENT_SERIAL      診斷服務(wù)宏: ASSERT、VERIFY      跟蹤服務(wù)宏: TRACE      異常處理宏: THROW 三、MFC數(shù)據(jù)類型  BOOL:布爾值,取值為TRUE or FALSE  BSTR:32-bit 字符指針  BYTE:8-bit整數(shù),未帶正負(fù)號(hào)  COLORREF:32-bit數(shù)值,代表一個(gè)顏色值  DWORD:32-bit整數(shù),未帶正負(fù)號(hào)  LONG:32-bit整數(shù),帶正負(fù)號(hào)  LPARAM:32-bit整數(shù),作為窗口函數(shù)或callback函數(shù)的一個(gè)參數(shù)  LPCSTR:32-bit指針,指向一個(gè)常數(shù)字符串  LPSTR:32-bit指針,指向一個(gè)字符串  LPCTSTR:32-bit指針,指向一個(gè)常數(shù)字符串,此字符串可以移植到Unicode(世界性的字符集)和DBCS(亞洲字符集)  LPTSTR:32-bit指針,指向一個(gè)字符串,此字符串可以移植到Unicode和DBCS  LPVOID:32-bit指針,指向一個(gè)未指定類型的數(shù)據(jù)  LPRESULT:32-bit數(shù)值,作為窗口函數(shù)或callback函數(shù)的返回值  UINT:在Win16中是一個(gè)16-bit 未帶正負(fù)號(hào)整數(shù),在Win32中是一個(gè)32-bit 未帶正負(fù)號(hào)整數(shù),  WNDPROC:32-bit指針,指向一個(gè)窗口函數(shù)  WORD:16-bit 整數(shù) ,未帶正負(fù)號(hào)  WPARAM:窗口函數(shù)或callback函數(shù)的一個(gè)參數(shù),在Win16中是16-bit,在Win32中是32-bit  下面這些是MFC獨(dú)特的數(shù)據(jù)類型  POSITION:一個(gè)數(shù)值,代表collection對(duì)象(例如數(shù)組或鏈表)中的元素位置,常用于MFC collection classes(即數(shù)據(jù)處理類,如CArray)  LPCRECT:32-bit指針,指向一個(gè)不變的RECT結(jié)構(gòu)
發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 普兰店市| 许昌市| 甘德县| 廉江市| 抚州市| 南乐县| 邮箱| 西城区| 民丰县| 大姚县| 贵港市| 威信县| 邻水| 徐汇区| 兴海县| 象山县| 垣曲县| 民县| 大荔县| 莱阳市| 香港 | 茂名市| 阿拉尔市| 德钦县| 长春市| 来安县| 襄樊市| 蒙阴县| 抚松县| 鹤壁市| 天长市| 汉阴县| 洛阳市| 贵南县| 蕉岭县| 武宣县| 鸡泽县| 灵璧县| 柳河县| 神木县| 湘阴县|