본문 바로가기
반응형

C & C++444

#pragma ? #pragma ? #pragma는 "#"을 보면 알 수 있듯이, #define과 같이 프리컴파일러 입니다. 전처리기 라고 하지요. #pragma는 다른 compiler에서 방해가 없이 C++ Builder에서 원하는 지시어를 정의할 수 있도록 해줍는 것입니다. 지시명을 인식하지 못한다면 에러를 내거나, #pragma의 지시를 무시합니다. #prama가 지원하는 지시어는 다음과 같습니다. 1. #pragma anon_struct #pragma anon_struct on #pragma anon_struct off - Class에 태크를 갖지않는 구조체를 포함하여 컴파일 하는것에 대한 허용여부를 나타냅니다. ex) #pragma anon_struct on struct st{ int i; // 태그가 없는 구조.. 2011. 4. 14.
파일 정보(File information) void FileInfomation(char *pszFileName) { HANDLE hFile; char szFileTime[100]; LARGE_INTEGER liFileSize; SYSTEMTIME st; FILETIME localTime; WIN32_FIND_DATA FileInformation; hFile = FindFirstFile(pszFileName, &FileInformation); memset(szFileTime,0x00, sizeof(szFileTime)); //파일 마지막 엑세스날짜 if(FileTimeToLocalFileTime( &FileInformation.ftLastAccessTime, &localTime )) { FileTimeToSystemTime(&localTime, &.. 2011. 4. 14.
[List] 리스트 컨트롤 정렬 How To Sort Items in a CListCtrl in Report View View products that this article applies to. Article ID : 250614 Last Review : July 13, 2004 Revision : 1.1 This article was previously published under Q250614 SUMMARY Not much information has been provided for the process of sorting the items in a ListView control, especially one wrapped by the CListCtrl MFC class. The details are easy to implement.. 2011. 4. 14.
[Message] Getmessage, Translatemessage, DispatchMessage, PeekMessage */ while(GetMessage(&Message,0,0,0)) { TranslateMessage(&Message); DispatchMessage(&Message); } /* 윈도우즈 프로그램에서 메시지를 처리하는 부분을 메시지 루프라고 하며 보통 WinMain 함수의 끝에 이와 같은 형식으로 존재한다. */ /* BOOL GetMessage( LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax); 이 함수는 시스템이 유지하는 메시지 큐에서 메시지를 읽어들인다. 읽어들인 메시지는 첫번째 인수가 지정하는 MSG 구조체에 저장된다. 이 함수는 읽어들인 메시지가 프로그램을 종료하라는 WM_QUIT일 경우 False를 리턴하며 그 외의 메시지이면 T.. 2011. 4. 14.
[Tip] 한라인씩 자동 스트롤 Contents Motivation Description Features Use The Demo CScrollerTestDlg::OnInitDialog() CTipsDialog::OnInitDialog() CTipsDialog::SwitchTip() Implementation Compatibility TODO Motivation: Well... I was bored the other day, and not wanting to do anything necessary, decided to write a little autoscroller. It turned out quite nicely, so I'm posting it here in the off chance it might be useful to some.. 2011. 4. 14.
[스레드] MFC에서 스레드(Thread) 사용하기 Abstract Frequently in the Visual C++ forum and multithreaded forum, questions are raised on how to start and stop threads and how to manipulate MFC UI elements from within a worker thread. This article will take the reader through the steps of building a simple MFC dialog application called StartStop. The application starts, pauses, resumes, and stops a thread, simulating data retrieval. In add.. 2011. 4. 14.
반응형