본문 바로가기

분류 전체보기290

MFC - GetLastError()에 해당하는 메세지 출력 GetLastError에 해당하는 메세지 얻어오기 LPVOID lpMsgBuf = NULL; CString strMsg; FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&lpMsgBuf, 0, NULL); if (!lpMsgBuf) { strMsg = (LPCTSTR)lpMsgBuf; LocalFree(lpMsgBuf); } 이를 토대로 함수를 만들어 보았습니다. Made by 꾸션 헤더 CString GetErrorDescription(DWORD dwLastErrorCode); CStr.. 2015. 2. 9.
MFC - [추천도서] Visual C++ 6 완벽가이드 2nd Edition Visual C++ 혹은 MFC를 공부를 막 시작하시려는 분들께 아래의 책을 소개해드립니다. 흔히, "눈깔이책"으로 유명한 책이죠. 2nd Edition으로도 알 수 있듯이 책의 구성이나 내용이 꽤 괜찮게 짜여져 있습니다. 각 Chapter별 예제도 CD로 제공하고 있어서, 초입단계 분들에게는 아주 유용하다고 생각됩니다. 목차는 아래와 같습니다. Part 1 기본 프로그래밍 Chapter 1 사전학습 Chapter 2 프로그램의 뼈대 Chapter 3 GDI를 이용한 그래픽 Chapter 4 대화상자와 컨트롤 Chapter 5 사용자 인터페이스 Chapter 6 도큐먼트의 데이터 관리 Part 2 고급 프로그래밍 Chapter 7 분할 윈도우와 다중 뷰 Chapter 8 다중 도큐먼트 프로그램 Chapt.. 2015. 2. 4.
MFC - 리스트컨트롤(CListCtrl) 대용량 데이터 처리 리스트 컨트롤에서 대용량의 데이터를 업데이트 하는 방법에 대해서 알아보겠습니다. CListCtrl클래스의 SetItemCount(), SetItemCountEx()함수를 사용하면 되는데, 사용 방법은 업데이트 할 데이터의 양을 먼저 위 두개의 함수를 사용하여 알려주고, 데이터를 입력하기만 하면 됩니다. 아래는 각 각의 함수를 사용하는 방법이며, MSDN에서 발췌하였습니다. CListCtrl::SetItemCount() https://msdn.microsoft.com/en-us/library/88tba5s4.aspx CString str; // Add 1024 items to the list view control. m_myListCtrl.SetItemCount(1024); for (int i = 0; i.. 2015. 2. 3.
MFC - 리소스에서 FileVersion 얻어오기 #pragma comment(lib, "version.lib") void main() { // 버전정보를 담을 버퍼 char *buffer = NULL; // 버전을 확인할 파일 char *name = "c:\\TestFolder\\test.exe"; DWORD infoSize = 0; // 파일로부터 버전정보데이터의 크기가 얼마인지를 구합니다. infoSize = GetFileVersionInfoSize(name, 0); if (infoSize == 0) return; // 버퍼할당 buffer = new char[infoSize]; if (buffer) { // 버전정보데이터를 가져옵니다. if (GetFileVersionInfo(name, 0, infoSize, buffer) != 0) { VS_F.. 2015. 2. 2.
MFC - 다이얼로그(Dialog)에 상태표시줄(CStatusBar)을 표시하기 Introduction Someone asked in the VC++ forum how they can add a status bar to a dialog and I foolishly replied saying that all they had to do was to have a CStatusBar member in their dialog class and that they should call Create() from the OnInitDialog() handler. Then someone else replied saying that it didn't work and then I tried it out myself and to my horror found that nothing happened. Anyh.. 2015. 2. 2.
MFC - 다이얼로그(Dialog)에 상태표시줄(CStatusBarCtrl)을 표시하기 Header public: CStatusBarCtrl m_StatusBar; CPP m_StatusBar.Create(WS_CHILD | WS_VISIBLE | SBT_OWNERDRAW, CRect(0, 0, 0, 0), this, 0); int strPartDim[4] = {180, 300, 300, 450 - 1}; m_StatusBar.SetParts(4, strPartDim); m_StatusBar.SetText("테스트1", 0, 0); m_StatusBar.SetText("테스트2", 1, 0); m_StatusBar.SetText("아이콘", 3, SBT_NOBORDERS); m_StatusBar.SetIcon(3, SetIcon(AfxGetApp()->LoadIcon(IDR_MAINFRAM.. 2015. 2. 2.
반응형