摘要:
为该程序在属性列表里面添加一条记录int CTrainingSystemDlg::OnCreate(LPCREATESTRUCT lpCreateStruct){ if (CDialog::OnCreate(lpCreateStruct) == -1) return -1; //设置标记 ::SetProp(m_hWnd, _T("UniqueMark"), AfxGetApp()->m_hInstance); return 0;}在InitInstance函数中判断标记是否存在,如果存在,则激活含有该标记的程序:HANDLE hMutex = ::CreateMut 阅读全文
摘要:
ini文件格式INI文件是由若干个段(section)组成的,每个段中包含若干关键字(key)及相应的值(value)。 例如[IS_OPEN]value=1[CONTENT]value="测试内容"[REJECT_MAIL]reject1=luo@sina.comreject2=book@sohu.com写ini文件BOOL WINAPI WritePrivateProfileString( __in LPCTSTR lpAppName, //section的名字 __in LPCTSTR lpKeyName, //key的值:如果不存在,... 阅读全文
摘要:
在InitInstance里面添加:HRESULT CoInitializeEx( void * pvReserved, //must be null currently DWORD dwCoInit //see the following definition to COINIT);typedef enum tagCOINIT { COINIT_MULTITHREADED = 0x0, COINIT_APARTMENTTHREADED = 0x2, COINIT_DISABLE_OLE1DDE = 0x4, COIN... 阅读全文