본문 바로가기

전체 글

(223)
[ST교육] thiscall 4 타이머 함수이다. // 1_thiscall4 #include #include #include #include "misoWindow.h" using namespace std; using namespace misowindow; class Clock; map map_clock; class Clock { string name; public: Clock(string s) : name(s) {} void Start(int ms) { int id = miso_SetTimer(ms,timerRoutine); map_clock[id] = this; } static void timerRoutine(int id) { Clock* pThis = map_clock[id]; cout name OnLButtonDown(); bre..
[ST교육] thiscall 3 멀티스레드 개념을 객체지향으로 캡슐화 해보자. #include #include #include using namespace std; DWORD __stdcall func(void* p) { return 0; } int main() { CreateThread(0, 0, func, "A", 0, 0); } func함수가 함수 포인터로 다른 스레드가 또 실행되고, 그 다음 "A"가 void* p로 전달된다. 아래 코드가 라이브러리 내부에 있는 클래스라고 가정해보자. #include #include #include using namespace std; class Thread { public: void run() { CreateThread(0,0,threadMain,this,0,0); } static DWORD ..
[ST교육] thiscall 2 함수포인터와 멤버 함수 // 2_thiscall #include class Dialog { public: void Close() {} static void Set() {} }; void Open() {} int main() { void(*func1)() = &Open;// a) void(*func2)() = &Dialog::Close;// b) void(*func3)() = &Dialog::Set;// c) void(Dialog::*func4)() = &Dialog::Close;// d) func4();// e) Dialog dlg; dlg.Close();// f) (dlg.*func4)();// g) return 0; } a)는 일반 함수를 일반 함수 포인터에 담는 것이다. 문제없이 실행된다.b)는 멤..
[ST교육] thiscall 1 ST 교육 들었던 것 정리 ! 1. this call 시작하기 전에 먼저 천천히 정리를 해보자! 클래스는 객체의 공통성을 표현하는 정의, 개념, 틀 형식이다. 클래스의 객체는 자신만의 멤버 변수와 멤버 함수를 갖는다. 클래스 내부에서 static으로 멤버 변수와 멤버 함수가 선언될 수 있다. static 멤버변수와 멤버함수는 멤버 변수, 함수보다도 일반 전역 변수, 함수와 비슷하며, 객체가 소유하지 않는 멤버 변수, 멤버 함수이다. 그렇다면 이런 객체가 소유하지 않는 멤버 변수, 멤버 함수를 왜 만드는 것일까? 말 그대로 static 은 객체와 무관한 변수, 함수를 만들 때 쓰인다. #include using namespace std; class Department { static int nCnt; pu..
char* char[] 을 검색해봤당 알고리즘 풀다가char* char[] 을 검색해봤당 https://kldp.org/node/114515 #include const char* ReturnStr(int n) { const char* str1 = "abc"; const char str2[] = "def"; if(n == 0) return str1; return str2; } int main() { const char* str; str = ReturnStr(0); printf("%s\n",str); str = ReturnStr(1); printf("%s\n",str); return 0; } const char* str1 = "abc";const char str2[] = "def; "abc"가 const 영역에 잡힌다. str1 은 "abc" ..
[진행중] 티스토리 초대장 배포합니다~!!! 제게 티스토리 초대장 10장이 있네요~필요하신분 댓글 달아주세요~ 개발 블로그 우선으로 드립니당★
D3D11 wireframe // 선언 ID3D11RasterizerState* WireFrame;ID3D11RasterizerState* FillFrame; // 초기화 D3D11_RASTERIZER_DESC wfdesc;ZeroMemory(&wfdesc,sizeof(D3D11_RASTERIZER_DESC)); wfdesc.FillMode = D3D11_FILL_WIREFRAME;wfdesc.CullMode = D3D11_CULL_NONE; // culling을 none으로 해줬다가_pd3dDevice->CreateRasterizerState(&wfdesc,&WireFrame);wfdesc.FillMode = D3D11_FILL_SOLID;wfdesc.CullMode = D3D11_CULL_BACK; // 다시 back culli..
visual studio warning 무시 하는 방법 이렇게 같은 warning이 자주날 때, warning을 무시하는 방법!! 속성 -> 구성 속성 -> C/C++ -> 고급 -> 특정 경고 사용 안 함 에 warning 숫자를 적어주면 된다. 또는 #pragma warning(disable : 4005) 이렇게 쓰면 된다. 근데 되도록이면 잡고가는게 좋을 듯 .....