본문 바로가기

Category

(302)
[MFC] Simplified MFC Structure MyFC.h #pragma once #include #include #ifndef AFXAPI #define AFXAPI __stdcall #endif //////////////////////////////////////// class CFrameWnd { public: CFrameWnd(); BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName); BOOL ShowWindow(int nCmdShow); void UpdateWindow(); private: HWND m_hWnd; }; //////////////////////////////////////// class CWinApp { public: CWinApp(); virtual BOOL InitIns..
[MFC] Simplest MFC Program #include class CMyWinApp : public CWinApp { public: BOOL InitInstance() { CFrameWnd *pFrameWnd = new CFrameWnd; m_pMainWnd = pFrameWnd; pFrameWnd->Create(0, TEXT("Hello")); // calls ::RegisterClass & ::CreateWindow pFrameWnd->ShowWindow(SW_SHOW); // calls ::ShowWindow pFrameWnd->UpdateWindow(); // calls ::UpdateWindow return TRUE; } }; CMyWinApp theApp; class CFrameWnd : public CWnd CFrameWnd::C..
[Hybrid] pinvoke , interop , C++/CLI , win32 DLL http://kofmania.tistory.com/112 http://chaoskcuf.com/entry/TIP-Visual-C-CLR-사용하기 연습: Windows Presentation Foundation 응용 프로그램에서 간단한 Win32 컨트롤 호스팅 http://msdn.microsoft.com/ko-kr/library/ms752055.aspx C#에서 Win32 API 사용하기 http://tjstory.tistory.com/47 동적으로 MFC에 링크하는 기본 DLL http://msdn.microsoft.com/ko-kr/library/30c674tx.aspx 닷넷 에서 Native c++ dll 사용하기 http://www.devpia.com/MAEUL/Contents/Detail.asp..
[Hybride] Visual C++ CLR 사용하기 Visual Studio를 C++ 컴파일러로 사용하셔도 Common Language Runtime(CLR)을 사용하시는 분은 잘 없으리라고 생각합니다. 일단 배포에도 문제가 있을테고, 굳이 C++ 프로젝트를 CLR을 사용하여 코드를 작성하기보다는 .NET Framework를 사용한다면 처음부터 C# 프로젝트로 생성하여 C#으로 작성하는 것이 훨씬 더 코드 작성에 효율적이기 때문이죠. 그리고 무엇보다도 C++ 에서 CLR 문법이 기존의 C++ 문법에 비해 생소하다는 것입니다. 그러나 CLR을 사용해서 코딩효과가 극대화 되는 경우도 있습니다. C/C++로 작성된 엔진을 사용할 때인데요. 어떠한 엔진을 사용하는데 Core 기술이라 C 혹은 C++로 작성되어 있는 경우가 있지요? 그러나 UI를 만들기 위해 WI..
[Hybrid] Mixing unmanaged C++, C++/CLI and C# in Visual Studio Solution Using Visual Studio 2010, I mixed unmanaged C++, C++/CLI and C# in one solution.
[C++] Regular Expressions Class: regex #pragma once #include #include #include #include #include #ifdef _UNICODE #define tcout wcout #define tcin wcin #define tstring wstring #else #define tcout cout #define tcin cin #define tstring string #endif #ifdef _UNICODE #define tregex wregex #define tcmatch wcmatch #define tsmatch wsmatch #else #define tregex regex #define tcmatch cmatch #define tsmatch smatch #endif using namespace std; voi..
[AutoHotkey] SetTimer & PostMessage "메모장 정보" 창이 뜰 때 마다 "확인" 버튼을 자동으로 클릭해주는 예제 #Persistent BM_CLICK := 245 SetTitleMatchMode, Regex OnExit, ExitSub SetTimer, MyLabel, 1000 return MyLabel: PostMessage, BM_CLICK , 0, 0, Button1, 메모장 정보 return ExitSub: SetTimer, MyLabel, Off ExitApp ; The only way for an OnExit script to terminate itself is to use ExitApp in the OnExit subroutine. #Persistent WM_CLOSE := 0x10 WM_COMMAND := 0x111 BM_CL..
[C#] Exception Tracing Sample Code string exceptionLogFile = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), @"Exception.txt"); private void checkBoxTopMost_CheckedChanged(object sender, EventArgs e) { try { this.TopMost = this.checkBoxTopMost.Checked; } catch (Exception ex) { StackFrame fr = new StackFrame(true); StackTrace st = new StackTrace(fr); MethodBase mb = fr.GetMethod(); recordExceptionLog(ex, mb.Name, f..