본문 바로가기

C / C++ / MFC

[MFC]CListCtrl > Selection change There are a few notifications based on what's happening. If you are selecting an item and nothing is selected yet, you will get one LVIF_STATE change notification: uNewState & LVIS_SELECTED. The newly selected item will be found at: pNMListView->iItem If an item is selected before you select a new object, you'll get three state changes: First you will be informed that the previous item in focus .. 더보기
SendMessage C++ to C# using WM_COPYDATA 1. C++ (Sender) typedef struct tagCOPYDATASTRUCT { ULONG_PTR dwData; DWORD cbData; CHAR* lpData; } COPYDATASTRUCT; char strChar[] = "20150601130012.xml"; //전송 할 STRING HWND hWnd = ::FindWindow(NULL, _T("XXXX")); //전송 할 Application Handle COPYDATASTRUCT cpd; cpd.dwData = 0; cpd.cbData = strlen(strChar); cpd.lpData = strChar; ::SendMessage(hWnd, WM_COPYDATA, NULL, (LPARAM)&cpd); 2. C# (Receiver) p.. 더보기
C++ 64비트 컨버팅 이슈 20 issues of porting C++ code on the 64-bit platform http://www.viva64.com/en/a/0004/ 더보기
[MFC]디렉토리 유무 확인 아래 API를 사용하면 된다. GetFileAttributes( LPCWSTR lpFileName ) 해당 경로에 폴더가 없을 경우 -1 리턴. Ex. if( GetFileAttributes( 경로 ) == -1) CreateDirectory( 경로, NULL ); 더보기
CString to char * , char * to CString 1. CString to char * CString strTemp; char buffer[MAX_PATH]; strcpy(buffer, (LPSTR)(LPCSTR)strTemp); 2. char * to CString CString strTemp; char buffer[MAX_PATH]; strTemp=(LPSTR)buffer; // (LPSTR)은 char *을 CString 형태로 변환. 출처 : http://blog.naver.com/rayofuth?Redirect=Log&logNo=14207270 더보기