본문 바로가기

VisualStudio.C++.C#   ( 290 )


MFC. 컴파일 경고 무시 #pragma, 속성설정. #pragma warning(disable: 번호) - 해당 소스파일 에 번호 에 해당하는것은 컴파일시 경고 발생하지 않는다. 예. 컴파일시 경고 아이디 C26812 가 있다면 #pragma warning(disable: 26812) - 1개의 소스파일에서 무시하려면 해당파일의 최상단 에 기록. - 헤더파일에 의 최상단에 기록하면 헤더파일 모든 소스파일에 경고무시 적용됨. 속성창에서 Disable Specific Warnings 설정. - 설정방법 : 프로젝트 속성창 : C/C++ -> Advanced -> Disable Specific Warnungs 란에 경고 번호 추가. - 프로젝트 전체에서 해당 경고 무시됨. 첫 등록 : 2020.09.14 최종 수정 : 단축 주소 : https://igotit... 2020. 9. 14.
Visual C++ 64bit, 32bit 프로젝트 개발 환경 셋팅. 개요 Visual C++ 프로젝트에서 만들어지는 실행파일을 32bit/ 64bit 모두 가능하게 하기위한 프로젝트 환경 설정법. 기본 사전 지식. 1. 32비트용/ 64비트용 프로젝트를 따로 만들 필요 없고 1개의 프로젝트에서 플랫폼을 32비트 혹은 64비트 선택하여 컴파일 함.2. Visual C++ 2015, 2017, 2019 에서 프로젝트 생성하면 기본 64비트/32비트 플랫폼 선택가능하게 되어있으나, Visual C++ 2010 에서는 64비트 플랫폼 선택가능하게 사용자가 설정해줘야 함. 방법 보기 -> http://igotit.tistory.com/1473. Visual C++ 컴파일과정에서 윈도우 , MFC 라이브러리들은 자동으로 선택된 플랫폼에 해당하는것이 임포팅되어 컴파일되므로 사용자가 .. 2020. 9. 14.
Visual C++. 솔루션 하위 폴더 . 프로젝트 하위 필터. 아이템 컨테이너 첫 등록 : 2020.09.14 최종 수정 : 단축 주소 : https://igotit.tistory.com/2588 2020. 9. 14.
MFC. pch.h precompiled header 사용하지 않음 설정 프로젝트 속성 에서 C/C++ -> Precompiled Header 의 오른쪽 리스트 항목중 Precompiled Header 를 Not Using Precompiled Headers 를 선택. 아래그림. 2020. 9. 13.
Visual C++ 2019 . WebSocket 구현 골격. cpprestsdk 기반. 개요 Visual C++ 2019 에서 웹소켓 구현하기 위한 라이브러리로 4종( cpprestsdk , libwebsocket, websocket++ , boost websocket) 정도의 후보가 있다. websocket ++ : www.zaphoyd.com/projects/websocketpp/ boost의 beast::websocket : www.boost.org/doc/libs/1_70_0/libs/beast/doc/html/beast/using_websocket.html 예제 : www.boost.org/doc/libs/1_70_0/libs/beast/doc/html/beast/quick_start/websocket_client.html stackoverflow.com/questions/9528.. 2020. 9. 9.
std::function<R(Args...)>::target std::function::target Returns a pointer to the stored callable function target. Return value A pointer to the stored function if target_type() == typeid(T), otherwise a null pointer. #include #include int f(int, int) { return 1; } int g(int, int) { return 2; } void test(std::function const& arg) { std::cout const T* target() const noexcept; (2) (since C++11) Returns a pointer to the stored calla.. 2020. 9. 8.
Fixed width integer types C99표준. stdint.h 에 정의 있음. uint8_t, uint64_t 등. Fixed width integer types (since C99) Types Defined in header int8_t int16_t int32_t int64_t signed integer type with width of exactly 8, 16, 32 and 64 bits respectively with no padding bits and using 2's complement for negative values (provided only if the implementation directly supports the type) int_fast8_t int_fast16_t int_fast32_t int_fast64_t fastest signed integer type with width of at l.. 2020. 9. 7.
win API . FindWindow , FindWindowEx // activate an application with a window with a specific class name BOOL CMyApp::FirstInstance() { CWnd *pWndPrev, *pWndChild; // Determine if a window with the class name exists... pWndPrev = CWnd::FindWindow(_T("MyNewClass"), NULL); if (NULL != pWndPrev) { // If so, does it have any popups? pWndChild = pWndPrev->GetLastActivePopup(); // If iconic, restore the main window if (pWndPrev->IsIconic.. 2020. 9. 5.
MFC.대화상자. x버튼 그레이처리 BOOL CCyFinMetaMain_UITDlg::OnInitDialog() { CDialogEx::OnInitDialog(); ModifyStyle(WS_SYSMENU, 0);// 우상단 최소화, 최대화, x 3개 모두 안보이게 하는것 // x버튼 그레이 처리하는것. CMenu *p_menu = this->GetSystemMenu(FALSE); p_menu->EnableMenuItem(SC_CLOSE, MF_BYCOMMAND | MF_GRAYED); return TRUE; } 첫 등록 : 2020.08.31 최종 수정 : 단축 주소 : https://igotit.tistory.com/2561 2020. 8. 31.
WM_COPYDATA . OnCopyData . CWnd * pWnd . WPARAM 개요 2개의 프로세스 사이에 SendMessage 함수로 메시지 송/수신과 동시에 구조체자료형 COPYDATASTRUCT 를 전송가능한 것. 즉 메시지 송신측에서 SendMessage 함수인자를 아래처럼 호출하면 HWND 에 해당하는 다른 프로세스에서 COPYDATASTRUCT 로 정의된 데이터 myCDS 를 수신가능하다. SendMessage (HWND, WM_COPYDATA, 0,(LPARAM)&myCDS); // 메시지 전송. myCDS 로 전송하기 위한 간단한 예. typedef struct { int a; int b; } MySTData; MySTData my_stdata; // 이 구조체를 COPYDATASTRUCT 의 lpData 로 송신하고자한다. COPYDATASTRUCT myCDS; /.. 2020. 8. 31.
C/C++. 실수 , 올림 내림 반올림 , ceil floor round #include // for c #include // for c++ ceil(2.8); // 반환값 3 floor(2.8); // 반환값 2 round(2.8); // 반환값 3 . C++ 11 부터 지원됨. round(2.4); // 반환값 2 ceil(-2.8); // 반환값 -2 floor(-2.8); 반환값 -3 round(-2.8); // 반환값 -3 . C++ 11 부터 지원됨. round(-2.4); // 반환값 -2 round - nearest integer value std::round, std::roundf, std::roundl, std::lround, std::lroundf, std::lroundl, std::llround, std::llroundf - cppreference.com.. 2020. 5. 26.
Critical Section (크리티컬 섹션) 개요 Critical Section (크리티컬 섹션) 을 설정한 구간은 한 번에 하나의 "스레드"에서만 사용가능하다. - 프로세스 내에 여러 스레드가 있는 환경에서, 우리가 설정해둔 "크리티컬 영역" 에 어떤 스레드가 먼저 진입하여 크리티컬 영역을 벗어나지 않은 상태에서는 동일 프로세스의 다른 스레드에서 해당 크리티컬 영역에 진입하는 것을 금지한다. - 후발 스레드의 "크리티컬 섹션" 진입금지 방식에 "리턴" 혹은 "대기"를 설정할 수 있다. "대기"란 선 진입한 스레드가 해당영역을 벗어날때까지 후발 스레드는 "대기" 상태로 있다가 선진입한 스레드가 해당영역 벗어나면 대기중인 후발 스레드가 크리티컬 영역을 실행하는것. "리턴"이란 후발 스레드는 "대기"상태에 있지 않고 "리턴"되어 크리티컬 영역 실행 하.. 2020. 5. 13.
jsoncpp. Json::Value , Json::Reader, Json::CharReader, Json::CharReaderBuilder 개요 . Json형식 문자열을 Json::Value 로 변환 jsoncpp 기반 Json::Value , Json::Reader 는 Visual C++ 2017 에서는 정상작동하나, Visual C++ 2019 에서는 사용 불가. VC++2019 에서는 Json::CharReaderBuilder 와 Json::CharReader 활용. Json::Reader - VC++2017 에서는 정상작동. VC++2019 에서 컴파일오류. #include // jsoncpp . 1.9.2 . from vcpkg -> nuget -> in this project std::string str_json; // 이 변수에 json형식의 문자열이 있다고 치자. Json::Value value_json; // Json::Va.. 2020. 5. 12.
libcurl. curl_easy_perform. perform a blocking file transfer #include CURLcode curl_easy_perform(CURL *easy_handle); Description Invoke this function after curl_easy_init and all the curl_easy_setopt calls are made, and will perform the transfer as described in the options. It must be called with the same easy_handle as input as the curl_easy_init call returned. curl_easy_perform performs the entire request in a blocking manner and returns when done, or i.. 2020. 5. 5.
Event Object, CreateEvent.WaitForSingleObject 개요 CreateEvent 는 이벤트개체를 생성하는 함수이며, 이벤트 개체가 생성되면 함수 SetEvent, ResetEvent 로 이벤트 상태를 제어할 수 있다. 이벤트 상태를 점검하기 위하여 함수 WaitForSingleObject 이용가능하다. 이벤트 개체는 1개의 프로세스 내부뿐만 아니라, 다른 프로세스에서도 공유가능하다. HANDLE hEvent_WaitQRead_LOBDelta = NULL; //2번인자 : TRUE. signal 이후 non-signal로 하려면 ResetEvent 해줘야 함., FALSE : signal 이후 자동으로 non-signal로 됨. 3번인자 true : 초기 signaled 상태. hEvent_WaitQRead = CreateEvent(NULL, TRUE, TR.. 2020. 4. 20.
VC++2017 버그. 클래스 위저드 에서 메시지 추가 기능 안되는 문제 해결 문제 증상. 대화상자에서 클래스 위저드로 메시지 추가 기능 안되는 경우 있음. 항상 발생하지는 않음. 해결책. 프로젝트 폴더에 숨김파일로 되어있는 .vs 폴더를 삭제하고 프로젝트 오픈하면 정상화 됨. 연관 포럼에 올라온 질문. https://developercommunity.visualstudio.com/content/problem/317820/mfc-class-wizard-add-message-not-working-correctly.html MFC Class Wizard Add Message Not Working Correctly - Developer Community Sign in Visual Studio Visual Studio for Mac .NET C++ Azure DevOps Azure Dev.. 2020. 4. 5.
C++. std::map . 키-값 컬렉션 #include /// 선언 std::map my_map_i_str; /// 요소추가 예. 키=3, 값 igotit my_map_i_str[3] = std::string("igotit"); /// 요소추가 my_map_i_str.insert(std::pair(3,std::string("igotit"))); /// 요소제거 my_map_i_str.erase(3); // 요소 모두제거 my_map_i_str.clear(); /// 요소받기 std::string my_str = my_map_i_str[3]; std::string my_str = my_map_i_str.at(3); /// 요소수량 받기. my_map_i_str.size(); /// 비어있나 점검. my_map_i_str.empty(); // 요.. 2020. 4. 1.
C/C++. 윈도우. 파일 저장, 읽기 . FILE . fopen, fprintf, fscanf 파일 저장하기 void save_file() { FILE* fp; float mydata[100]; fp = fopen("test.txt","w"); // 파일열었음.인자1 파일명. 인자2 w 의미 기록용도. for (int idx = 0; idx < 100; idx++) { fprintf(fp, "%f\n", mydata[idx]); } fclose(fp); } 파일 읽기 void read_file() { FILE* fp; float mydata[100]; fp = fopen("test.txt","r"); // 파일열었음.인자1 파일명. 인자2 r 의미 읽기용도. for (int idx = 0; idx < 100; idx++) { fscanf(fp, "%f\n", &mydata[idx]); } fclo.. 2020. 3. 29.


 

비트코인




암호화폐       외환/나스닥/골드       암호화폐/외환/나스닥/골드 암호화폐/외환/나스닥/골드   암호화폐/외환/나스닥/골드
     
현물 |선물 인버스 |선물 USDT       전략매니저(카피트레이딩)     롤오버 이자 없는 스왑프리계좌
( 스왑프리 암호화폐도 거래 가능 )    
MT4, MT5 , cTrader 모두 지원     FTMO 계좌 매매운용. MT4,MT5