반응형 C & C++444 [List] List 컨트롤에 ComboBox 사용하기 리스트 컨트롤 스타일중 Report 로 이용시 컬럼 내부에 콤보 박스를 넣는 방법에 대해서 소개합니다. 버튼이나 특정 이벤트를 통해서 컬럼의 값을 변경하는 것이 아닌, 콤보 박스를 이용하여 리스트 컨트롤 내부에서 컬럼의 값을 변경한다는 것은 상당히 큰 매리트가 있습니다. 소스는 두개의 클래스로 되어있습니다. CListCtrl 을 상속받는 클래스(이하 CAdvListCtrl)와, CComboBox를 상속받는 클래스(이하 CAdvComboBox)입니다. CAdvListCtrl 클래스의 경우엔 CAdvComboBox에서 발생하는 주요 이벤트 (Selection 변경, 키 입력, 포커스 드롭 등)를 받아 컬럼 내용을 처리해주는데 주 목적이 있습니다. 물론 리스트 컨트롤 포커싱(마우스클릭 등 포커스가 잡혔을때)시.. 2011. 5. 4. [List] 리스트 컨트롤에 색상입히기 Introduction Version 4.70 of the common controls introduced a feature called custom draw. The name gives a vague hint about what it's about and the MSDN docs give some long-winded explanations and examples, but there's no one place that tells you what you really want to know. That is, namely, what's it good for. Custom draw can be thought of as a light-weight, easier-to-use version of owner draw.. 2011. 5. 4. API 주요 함수 AdjustWindowRect : BOOL AdjustWindowRect(LPRECT lpRect, DWORD dwStyle, BOOL bMenu); 작업 영역의 크기는 윈도우 크기에서 타이틀 바와 경계선, 메뉴, 스크롤 바 등의 영역을 제외한 영역이다. 일반적으로 MoveWindow, SetWindorPos 등의 함수로 윈도우 크기는 원하는대로 바꿀 수 있지만 작업 영역의 크기를 원하는대로 설정하는 방법은 없다. 작업 영역을 특정한 크기대로 설정하려면 이 함수로 원하는 윈도우 크기를 먼저 계산하고 MoveWindow 등의 함수로 윈도우 크기를 변경해야 한다. 이 함수는 윈도우의 스타일(타이틀 바의 유무, 타이틀 바의 높이, 경계선의 두께)와 메뉴의 존재 여부 등을 고려하여 작업 영역의 크기가 lpRec.. 2011. 4. 29. 사용자 정의 이벤트(Event) 사용자 정의 이벤트(Event) MFC 를 사용하면서 이벤트를 등록하는 방법 (보통 View 클래스에 등록을 많이 하므로 기준을 View클래스에 두고 설명 한다.) 1.View클래스 헤더 파일에 #define WM_ (WM_USER+숫자) 이렇게 정의한다. #define WM_SUN (WM_USER+2) 2. 헤더 상단 하단 부분의 DECLARE_MESSAGE_MAP 에 SendMessage가 호출하게 되는 afx_msg 함수를 정의한다.protected://Generated message map functions//{{AFX_MSG(CProgressBar_TWO) afx_msg LRESULT TestSUN(WPARAM,LPARAM);//}}AFX_MSGDECLARE_MESSAGE_MAP() 3.클래스의.. 2011. 4. 29. [Tip] 로그인 인증 확인 [ DB 이용] void CloginDlg::OnBnClickedOk() { UpdateData(TRUE); CloginDlg Dlg; CWnd* m_pMainWnd; m_pMainWnd = ::AfxGetMainWnd(); loginOdbc namecard; namecard.Open(); //레코드셋 열기 CString id = m_idedit; //ID에디트창의 Value변수를 id에 저장 CString pass = m_pass; //Pass에디트창의 Value변수를 pass저장 if(namecard.IsBOF()) return; //현재 레코드가 처음보다 순서상으로 앞서는 검사 while(!namecard.IsEOF()){ //현재레코드가 빈레코드인지 검사 CString DBid = namecard.. 2011. 4. 28. [공통] 메모리 누수 추적 Table of Contents Introduction What's New? Using Visual Leak Detector Making a Memory Leak Detector Key Parts of the Source Code Known Bugs and Restrictions Credits References License History Introduction Visual C++ provides built-in memory leak detection, but its capabilities are minimal at best. This memory leak detector was created as a free alternative to the built-in memory leak detector pr.. 2011. 4. 28. 이전 1 ··· 34 35 36 37 38 39 40 ··· 74 다음 반응형