QListCtrl.cpp
上传用户:cnjubao
上传日期:2007-01-02
资源大小:34k
文件大小:3k
- /************************************
- REVISION LOG ENTRY
- Revision By: Mihai Filimon
- Revised on 11/2/98 6:35:14 PM
- Comments: QListCtrl.cpp : Implementation of CQListCtrlApp and DLL registration.
- ************************************/
- #include "stdafx.h"
- #include "QListCtrl.h"
- #include "TLabelEdit.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- CQListCtrlApp NEAR theApp;
- const GUID CDECL BASED_CODE _tlid =
- { 0xbfcc1bc3, 0x7257, 0x11d2, { 0x86, 0xe6, 0, 0x40, 0x5, 0x5c, 0x8, 0xd9 } };
- const WORD _wVerMajor = 1;
- const WORD _wVerMinor = 0;
- const TCHAR _separatorColumnHeader = TCHAR('|');
- const TCHAR _separatorHeader = TCHAR(':');
- ////////////////////////////////////////////////////////////////////////////
- // CQListCtrlApp::InitInstance - DLL initialization
- // Function name : CQListCtrlApp::InitInstance
- // Description :
- // Return type : BOOL
- BOOL CQListCtrlApp::InitInstance()
- {
- BOOL bInit = COleControlModule::InitInstance();
- if (bInit)
- {
- CTLabelEdit::RegClassLabelEdit();
- AfxEnableControlContainer();
- }
- return bInit;
- }
- ////////////////////////////////////////////////////////////////////////////
- // CQListCtrlApp::ExitInstance - DLL termination
- // Function name : CQListCtrlApp::ExitInstance
- // Description :
- // Return type : int
- int CQListCtrlApp::ExitInstance()
- {
- // TODO: Add your own module termination code here.
- return COleControlModule::ExitInstance();
- }
- /////////////////////////////////////////////////////////////////////////////
- // DllRegisterServer - Adds entries to the system registry
- STDAPI DllRegisterServer(void)
- {
- AFX_MANAGE_STATE(_afxModuleAddrThis);
- if (!AfxOleRegisterTypeLib(AfxGetInstanceHandle(), _tlid))
- return ResultFromScode(SELFREG_E_TYPELIB);
- if (!COleObjectFactoryEx::UpdateRegistryAll(TRUE))
- return ResultFromScode(SELFREG_E_CLASS);
- return NOERROR;
- }
- /////////////////////////////////////////////////////////////////////////////
- // DllUnregisterServer - Removes entries from the system registry
- STDAPI DllUnregisterServer(void)
- {
- AFX_MANAGE_STATE(_afxModuleAddrThis);
- if (!AfxOleUnregisterTypeLib(_tlid, _wVerMajor, _wVerMinor))
- return ResultFromScode(SELFREG_E_TYPELIB);
- if (!COleObjectFactoryEx::UpdateRegistryAll(FALSE))
- return ResultFromScode(SELFREG_E_CLASS);
- return NOERROR;
- }
- LPWSTR WINAPI AtlA2WHelper(LPWSTR lpw, LPCSTR lpa, int nChars)
- {
- _ASSERTE(lpa != NULL);
- _ASSERTE(lpw != NULL);
- // verify that no illegal character present
- // since lpw was allocated based on the size of lpa
- // don't worry about the number of chars
- lpw[0] = ' ';
- MultiByteToWideChar(CP_ACP, 0, lpa, -1, lpw, nChars);
- return lpw;
- };