본문 바로가기
반응형

vc 12

[개발/VC] 웹페이지 마우스 위치에 있는 엘리먼트 얻어오기 [개발/VC] 웹페이지 마우스 위치에 있는 엘리먼트 얻어오기 if (SUCCEEDED(hr)) { IHTMLEventObj* pEvtObj; hr = pParentWindow->get_event(&pEvtObj); pParentWindow->Release(); if (SUCCEEDED(hr)) { long clientX = 0L, clientY = 0L; pEvtObj->get_clientX(&clientX); pEvtObj->get_clientY(&clientY); pEvtObj->Release(); IHTMLElement* pHTMLElement = NULL; hr = pDocument->elementFromPoint(clientX, clientY, &pHTMLElement); .... ... } 2011. 9. 27.
[개발/VC] 인터넷 연결체크 // 인터넷 연결체크 // #include // #pragma comment(lib, "wininet.lib") BOOL IsConnectedInternet() { DWORD dwFlag; BOOL bChkInternet = InternetGetConnectedState(&dwFlags, 0); if (!bChkInternet) { AfxMessageBox("It is not conntected to internet"); return FALSE; } return TRUE; } 2011. 9. 27.
[개발/MFC] GetLastError(), System Error Codes (0-999) GetLastError()함수로 얻게 되는 에러코드로 아래으 에러코드에 대한 에러 메세지의 의미를 알 수 있다. **System Error Codes (0-499) The following table provides a list of system error codes ( errors 0 to 499). They are returned by the GetLastError function when many functions fail. To retrieve the description text for the error in your application, use the FormatMessage function with the FORMAT_MESSAGE_FROM_SYSTEM flag. Table with 2 c.. 2011. 9. 20.
[개발/VC] 파일을 쓰고 읽기 파일을 열고 닫기 HANDLE hFile; hFile = CreateFile("File.txt", GENERIC_READ | GENERIC_WRITE, FILE_SHARED_READ, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); if(hFile != INVALID_HANDLE_VALUE) { //파일을 사용한다. //파일을 닫는다. CloseHandle(hFile); } 파일을 읽거나 쓰기 HANDLE hFile; hFile = CreateFile("File.txt", GENERIC_READ | GENERIC_WRITE, FILE_SHARED_READ, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); if(hFile != .. 2011. 8. 17.
[개발/VC] xdebug, xlocale 관련 error [개발/VC] xdebug, xlocale 관련 error 컴파일이나 빌드를 하면 xdebug, xlocale 관련 에러가 무지하게 많이 발생하는 경우가 생긴다. 이 에러는 다음과 같이 해결할 수 있다. 단 번에 해결이 안되더라도 꼼꼼하게 소스파일을 찾아서 수정해야한다. #ifdef _DEBUG #define new DEBUG_NEW #endif 항상 .cpp 파일에서 위의 3줄 위에 #include 나 #pragma comment(lib, ...)를 선언해야 한다. 쌈꼬쪼려 소백촌닭 2011. 6. 16.
[개발/MFC] LPSTR LPCTSTR 위험 CStrgin -> char 으로 변환 (LPSTR)(LPCTSTR)csTest은 위험하다.!! -. 유니코드를 고려하지 않았을뿐 아니라 -. 위험하게 내부데이터를 접근합니다. CString strPP; char * chNN = (LPSTR)(LPCSTR)strPP; 이렇게 해서 chNN을 CString의 포인터로 가져 옵니다. (LPSTR)(LPCSTR)strPP 이 부분 에서 이유는 MSDN을 찾아보시면 아시겠지만 CString은 const char * 으로 만 받을수 있답니다. 그래서 (LPCTSTR)strPP 이런 형식으로도 사용합니다. 물론 const char *으로 return되겠죠.. 다시 char *을 필요하신다면 char * chNN = (char *)(LPCTSTR)strPP; 이런 식으로도 사용합니다 char *pstr =.. 2011. 2. 14.
반응형