c++
-
[C++, MS VS2019] LNK2019 Error프로그래밍/C++ 2019. 11. 5. 18:30
LNK2019 __imp_SetupDiDestroyDeviceInfoList 외부 기호(참조 위치: "public: void __cdecl CkbftestMFCTestDlg::OnBnClickedBtnFilterOnoff(void)" (?OnBnClickedBtnFilterOnoff@CkbftestMFCTestDlg@@QEAAXXZ) 함수)에서 확인하지 못했습니다. kbftestMFCTest 라이브러리의 종속성 문제로 인한 링크 에러(Link Error). 아래와 같이 간단하게 해결된다. [ 프로젝트 -> 속성 -> 구성 속성 -> 링커 -> 입력 -> 추가 종속성 -> Setupapi.lib ] 다만, 여기서 [Setupapi.lib] 을 적어준 것은, Error 메시지에 표시된 api가 해당 lib에..
-
[C++, MS VS2019] MSB8040 Error프로그래밍/C++ 2019. 11. 5. 18:15
MSB8040 Spectre-mitigated libraries are required for this project. Install them from the Visual Studio installer (Individual components tab) for any toolsets and architectures being used. Learn more: https://aka.ms/Ofhn4c kbftestMFCTest C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets 425 최근 포맷 이후, VS2017에서 사용하던 프로젝트를 2019에서 도구모음 ..
-
[C++] 작업표시줄 크기 구하기프로그래밍/C++ 2019. 7. 23. 18:13
윈도우 작업표시줄의 크기를 구하는 간단한 구문입니다. RECT taskbarRect; HWND hTaskbar = FindWindow(_T("Shell_TrayWnd"), NULL);//작업표시줄 핸들러 가져오기 if (hTaskbar) { ::GetWindowRect(hTaskbar, &taskbarRect); } //if (taskbarRect.top > 0)//top 좌표가 0보다 크면, 작업 표시줄이 아래에 있음. //else if (taskbarRect.left > 0)//left 좌표가 0보다 크면, 작업 표시줄이 오른쪽에 있음. //else if (taskbarRect.right < window.right)//right 좌표가 현재 창의 right보다 작으면, 작업 표시줄이 왼쪽에 있음. /..
-
[c++, VS2013] Visual Studio 2013 Error: c4996 this function or variable may be unsafe프로그래밍/C++ 2019. 5. 24. 13:42
Visual Studio 2013에서 scanf 를 쓰려다보니 발생하는 에러. 해당 에러 메시지를 잘 읽어보면 해결방법이 나와있다. 해당 에러가 출력되는 코드 혹은 해당 코드가 물고있는 헤더에 다음을 추가해주자. #define _CRT_SECURE_NO_WARNINGS 임시 방편이긴 하지만, 간단히 해결하고 넘어가는게 가능하다. 하지만 되도록 에러 메시지에도 나와있듯, scanf -> scanf_s 처럼 추천하는 해결책을 이용하기 바란당.
-
[C++, rapidjson] AddMember 시의 형변환 문제프로그래밍/C++ 2019. 5. 14. 13:06
rapidjson 을 사용해 array 형태의 json message 를 만들다보니.. 내가 원하는건 std::string 을 사용해서 A :{[B:C, D:F]} 형태로 모두 string 으로 이뤄진 배열을 만드는 것. rapidjson::Document tempres; tempres.SetObject(); rapidjson::Value integrityArray(rapidjson::kArrayType); rapidjson::Document::AllocatorType& allocator = tempres.GetAllocator(); for (auto iter : *objArray) { rapidjson::Value objValue; rapidjson::Value strValue; objValue.Set..
-
[C++] std::string convert std::wstring프로그래밍/C++ 2019. 5. 14. 00:08
std::string -> std::wstring std::string str = "I want convert this string"; std::wstring wstr; str.assign(wstr.begin(), wstr.end()); std::wstring -> std::string std::wstring wstr = "I want convert this string"; std::string str; wstr.assign(str.begin(), str.end());
-
[MFC] CString 문자열의 Delete 함수프로그래밍/C++ 2016. 12. 20. 18:30
int Delete( int nIndex, int nCount = 1); 해당 함수는 위와 같은 형태를 가짐. nIndex 의 위치에서부터 nCount 만큼의 문자열을 지운다. 여기서 주의할 점은... nIndex 에 마찬가지로 CString 에서 제공하는 GetLength 함수를 사용했을 경우엔 꼭 -1을 해주자.....ㅠ 하...! https://msdn.microsoft.com/ja-jp/library/ms928979.aspx
-
C++ error LNK2038 관련 불일치가 검색되었습니다 라는 메시지.프로그래밍/C++ 2016. 12. 14. 16:17
해당 메시지는 서로 다른 버젼의 C RunTime Library를 사용하기 때문에 발생. 해당 에러가 발생하는 프로젝트와 LIB 파일을 생성한 프로젝트의 CRT를 일치시켜줘야 함. 본인은 MTd 로 맞춰줌. 프로젝트 속성 -> C/C++ -> 코드 생성 -> 런타임 라이브러리 참고 : http://stackoverflow.com/questions/14714877/mismatch-detected-for-runtimelibrary