본문 바로가기

Programming

(143)
64bit 구별 방법 개발을 하다보면 32bit와 64bti용으로 제작 해야 될 때가 많죠~ 그럴때 해당 PC가 어떤 플랫폼인지 구별해야할 때가 있는데 그럴때 사용하는 코드입니다. 방법1) 다음과 같이 kernel32에서 64bit인지 프로세스를 얻어내서 사용하는 방법이 있습니다. [DllImport("kernel32.dll")] public static extern bool IsWow64Process(System.IntPtr hProcess, out bool lpSystemInfo); public static bool IsWow64Process1 { get { bool retVal = false; IsWow64Process(System.Diagnostics.Process.GetCurrentProcess().Handle, o..
C# Coding Standards and Best Programming Practices dotnetspider.com에서 C#을 사용할 때 지켜야 할 기본 규칙을 정리한 문서입니다. 출처 : http://www.dotnetspider.com/tutorials/BestPractices.aspx 목차 1. Author 2. License, Copyrights and Disclaimer 3. Revision History 4. Introduction 5. Purpose of coding standards and best practices 6. How to follow the standards across the team 7. Naming Conventions and Standards 8. Indentation and Spacing 9. Good Programming practices 10. Ar..
Trac 업데이트(0.11.5 -> 0.12) 저번주 Trac을 업데이트 한다고 나름 테스트 서버에서 확인 하고 실서버 적용했는데.. 이런 과부하가 걸릴줄이야 알고 보니 업데이트 과정중에 플러그인을 하나 설치 안한 듯 하다. Trac 업데이트 순서 이다. (각각의 플러그인 설명은 다른 사이트 참조) Trac(0.11.5 -> 0.12 업데이트) 1. cd C:\Python25\Lib\Site-Package 2. easy_install Genshi 3. easy_install ElementTree 4. easy_install Babel 5. easy_install --upgrade Trac=0.12 6. Apache 재시작 7. 현재 trac 사이트 업데이트 trac-admin c:\trac\test 위의 순서대로 설치 하니깐 잘 설치가 되었다. 원래..
다중 커멘트라인 입력 받기 MFC 프로그램 하다 보면 커멘드 라인으로 입력을 받아야 할 때가 많이 있다. 방법은 아래와 같다. CString strArglist[MAX_PATH]; int nArgs; int i; szArglist = CommandLineToArgvW(GetCommandLineW(), &nArgs); if( NULL == szArglist ) { AfxMessageBox(_T("CommandLineToArgvW failed")); } else { for( i = 0; i < nArgs; i++ ) AfxMessageBox(strArglist[i]); }
/unsafe 모드 사용 C#에서는 형식 안전성과 보안을 유지하기 위해 기본적으로 포인터 산술 연산을 지원하지 않습니다. 그러나 unsafe 키워드를 사용하면 포인터를 사용할 수 있는 안전하지 않은 컨텍스트를 정의할 수 있습니다. 포인터에 대한 자세한 내용은 포인터 형식 항목을 참조하십시오. 주로 C#에서 C의 포인터를 참조하기 위해서 쓰입니다. 설정 unsafe를 사용하기 위해서는 속성을 변경해야 합니다. 프로젝트에서 [속성]-[빌드] 로 이동하면 중간쯤에 안전하지 않은 코드 허용 이 보인다. 이 곳이 체크 되어 있지 않으면 체크 해줍니다. 사용방법 namespace TestApp { unsafe struct UseUnSafe { int nAddCount; public pATT* nextNode; } } 좀 더 자세한 방법은 ..
GDI+에서 일반 오류가 발생했습니다. 빌드를 하다가 GDI+ 오류가 생길 수 있다. 다음 같은 경우 해결방법은 아래 사이트 에서 제공되고 있다. Infragistics.WebUI.UltraWebChart.UltraChart.Render(HtmlTextWriter output) +11186 System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +243 System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +72 System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +44 System.Web.UI.HtmlControls.HtmlForm.Render(HtmlText..
Taskbar 숨기기 프로그램들을 실행하다보면 하단에 taskbar에 실행중인 목록들이 보이는데, 너무 많은 목록들의 나열로 인해서 지저분 할 때가 있다. 이럴때는 다음과 같이 taskbar를 숨겨서 깔끔한 상태를 유지하자. COM Lib에 보면 다음과 같이 taskbar에 대한 내용을 정리 하고 있다. DECLARE_INTERFACE_(ITaskbarList,IUnknown) { STDMETHOD(QueryInterface)(THIS_ REFIID riid,LPVOID* ppvObj) PURE; STDMETHOD_(ULONG,AddRef)(THIS) PURE; STDMETHOD_(ULONG,Release)(THIS) PURE; STDMETHOD(ActiveTab)(HWND) PURE; STDMETHOD(AddTab)(HWN..
Dialog 숨기기 MFC 관련 프로그램에서 해당 Dialog를 숨기고 싶다면 다음과 같이 Windows Style을 수정하면된다. MSDN 참고 virtual BOOL ModifyStyleEx( DWORD dwRemove, DWORD dwAdd, UINT nFlags ); Parameters dwRemove The extended styles to be removed from the current windows styles. dwAdd The extended styles to be added from the current windows Style. nFlags Windows positioning flags, For a list of possible values see the SetWindowPos function in t..

반응형