본문 바로가기

프로그래밍83

[API] GetTickCount 를 이용한 타이머 구현 // 마지막 시간 DWORD last_tt=GetTickCount(); // 현재 시간 DWORD tt=GetTickCount(); // 시간차를 구한다. float d=(float)tt-last_tt; d/=1000; // 현재 시간을 마지막 시간으로 기억한다. last_tt=tt; 2009. 10. 28.
curl 컴파일 link 실패 Mike – I got the same linker errors when trying to link against the static lib (curllib_static.lib). Switch to the dll (curllib.lib) and it should be ok. Although of course you will need to have curllib.dll on your path (along with any other dependencies like ssleay32.dll etc which you can get from the libcurl root folder). 2009. 10. 24.
[WIN32] 타이틀바 높이 알아내기 타이틀바의 높이를 알아 올 일이 생겼습니다. API 함수를 쓰면 쉽게 해결 할 수 있습니다. int WINAPI GetSystemMetrics(int nIndex ); 사실 GetSystemMetrics 함수는 매개변수에 따라 여러가지 기능을 하는데요. 주로 시스템의 구성이나 설정을 얻어올 때 사용됩니다. 시스템 영역의 정보를 얻어오려면 이 함수의 기능을 찾아보면 거의 있습니다. 그중에서 이번엔 타이틀바의 높이를 알아오는 방법을 알아보겠습니다. 타이틀바의 높이는 SM_CYCAPTION 플래그를 매개변수로 넣어주어 리턴되는 값으로 얻어 올 수 있습니다. 2009. 9. 23.
CString 형변환 출처 : http://rainbird.springnote.com/pages/152001?print=1 CString 형변환 CString -> BYTE BYTE* temp; CString cmd; 에서 cmd 의 값을 temp에 할당하려 할때. temp=new BYTE[255]; temp=(LPBYTE)(LPCSTR)cmd; delete []temp; or CString str = _T("abcd"); BYTE* pbyte = new BYTE[256]; int nSize; nSize = str.GetLength(); CopyMemory( pbyte, str.GetBuffer(nSize), nSize ); pbyte[nSize] = 0; or strcpy(szNamePlace,(LPCTSTR)name); .. 2009. 9. 21.