검색결과 리스트
Technical Article에 해당되는 글 282건
- 2004.12.02 VS 자주쓰는 소스를 관리해 BoA요~
- 2004.12.01 char <-> wchar 변환
- 2004.11.30 volatile 용도? (서버 유저 카운터)
- 2004.11.29 GDI+ 리소스에서 이미지 긁어오기~
- 2004.11.29 GDI+를 사용해 BoA요~ (PNG출력까지~)
- 2004.11.26 The Groovyness of the Gallery 1
- 2004.11.22 접속자수 이상해지는거~~ volatile
- 2004.11.15 윈도우 시작프로그램들 레지스트리 위치!
- 2004.10.24 [펌] 디버깅과 탐정 놀이
- 2004.10.22 디버그 모드 vs 릴리즈모드...
글
Technical Article/펌 2004. 12. 2. 11:30VS 자주쓰는 소스를 관리해 BoA요~
1. 클래스를 만든다. 코딩질~
2. Class뷰에서 해당클래스 오른쪽 클릭.
Add to Gallery. (별 반응은 없음 ^^).
단, 저장될때 해당프로젝트 이름의 폴더에 들어가니까~
FiaToolLibrary 라던지.... 자기 맘대로 프로젝트를 하나 만들어서
하면 이름을 바꿔야 하는 수고를 덜수 있다.
여기까지가 추가~
1. 필요한 프로젝트를 생성해서 메뉴 Project->Add To Project->Components and Control
2. 아까 추가했던 클래스를 선택하면 프로젝트에 바로 추가된다.
기본 설치시 경로 :
C:Program FilesMicrosoft Visual StudioCommonMSDev98Gallery
라입으로 묶기 애매한 조그마한 모듈 같은 경우에 사용하면
소스저장하고 복사해서 붙이고 하는 삽질을 좀 줄일수 있을거 같다.
2. Class뷰에서 해당클래스 오른쪽 클릭.
Add to Gallery. (별 반응은 없음 ^^).
단, 저장될때 해당프로젝트 이름의 폴더에 들어가니까~
FiaToolLibrary 라던지.... 자기 맘대로 프로젝트를 하나 만들어서
하면 이름을 바꿔야 하는 수고를 덜수 있다.
여기까지가 추가~
1. 필요한 프로젝트를 생성해서 메뉴 Project->Add To Project->Components and Control
2. 아까 추가했던 클래스를 선택하면 프로젝트에 바로 추가된다.
기본 설치시 경로 :
C:Program FilesMicrosoft Visual StudioCommonMSDev98Gallery
라입으로 묶기 애매한 조그마한 모듈 같은 경우에 사용하면
소스저장하고 복사해서 붙이고 하는 삽질을 좀 줄일수 있을거 같다.
트랙백
댓글
글
Technical Article/펌 2004. 12. 1. 14:32char <-> wchar 변환
WideCharToMultiByte , MultiByteToWideChar 이런걸로 해도 되지만.. 인자 다집어넣을려면 귀찮다 ㅡㅡ;
심플하게 (물론 내부에서는 호출한다) 하는 방법....
[CODE] #include <ATLConv.h> USES_CONVERSION; // <= 필요한 변수선언한 define 변환전에 추가 CString(char) -> wchar로 A2W((LPTSTR)m_strPath.GetBuffer(512)) ... wchar -> char W2A(wchar형변수) [/CODE]
심플하게 (물론 내부에서는 호출한다) 하는 방법....
[CODE] #include <ATLConv.h> USES_CONVERSION; // <= 필요한 변수선언한 define 변환전에 추가 CString(char) -> wchar로 A2W((LPTSTR)m_strPath.GetBuffer(512)) ... wchar -> char W2A(wchar형변수) [/CODE]
트랙백
댓글
글
Technical Article/펌 2004. 11. 30. 16:11volatile 용도? (서버 유저 카운터)
작 성 자 用昇(dewy07) 첨부
파일
작성시각 2003-10-02 오후 1:02:06 조 회 수 297
글 분 류 VC++ 일반
http://www.kwak101.pe.kr/kwak101/main.html
---------------------------------------------------
*초기작성일 : 2003/03/22
*작성/저작: 곽용재(kwak101@hitel.net)
*최종수정일 : 2003/08/11
*수정에 도움 주신분:
- 강기현(testors@phantagram.com) 님
---------------------------------------------------
* volatile 이란?
말 그대로 따지면, "그 변수를 휘발성 메모리에 만들어라"라는 뜻입니다.
일반적으로 컴퓨터 분야에서 '휘발성(volatileness) 메모리'라고 하면, 전원을 끄면 데이터가 날아가는 메모리란 뜻을 의미합니다. 한데, 웃기죠? 우리가 사용하는 컴퓨터는 전원을 끄면 데이터가 모두 날아간단 말씀입니다. (물론 배터리 백업이 되는 S-RAM이나 반영구 저장이 가능한 플래쉬메모리 이야기는 제외합니다. 대부분 이들 메모리는 데이터 저장용으로만 쓰니까요.)
제가 10여년 전 C를 처음 공부하고 쓸 때, volatile이란 키워드는 register 키워드와 반대로 생각하라고 저는 배웠습니다. 즉, volatile로 선언한 변수는 절대로 레지스터 변수(register 키워드가 붙은 변수)로 만들어지지 않습니다.
그렇다면, 레지스터 변수에 대해 아셔야 겠죠? 레지스터 변수는 말 그대로 CPU가 사용하는 임시 저장용 고속 메모리인 레지스터를 저장 영역으로 사용하는 변수입니다. 요즘 나오는 컴파일러는 꽤 똑똑해서, 굳이 register라고 선언하지 않아도 빠른 데이터 교환이 필요한 코드에 사용되는 변수는 레지스터 변수로 바꿔줍니다.
예를 들어, 양변기 수온을 재는 센서(둔감한 센서)를 컴퓨터에 물리고, 이 센서가 측정한 값이 30도를 넘으면 누군가가 소변을 본다고 알려주고, 30도 아래이면 아무도 없음을 알려주는 코드를 작성한다고 합시다. 어떤 온도값을 담는 전역변수를 두고(뭐 간단하게 짜려고 하니까...^^) 메인 프로그램은 무한루프를 돌면서 어떤 온도값에 따라 적절한 메시지를 출력하고, 이차스레드는 역시 무한루프를 돌면서 끊임없이 이 센서의 측정값을 감시해서 온도값을 갱신합니다. (무지하게 비효율적인 코드이지만, 어쨌든...^^;)
// 메인 프로그램
...
double deg=20; // deg는 센서가 보내준 값
while(true)
{
if( deg>30)
messageOut("소변 봄");
else
messageOut("소변 안 봄");
}
...
// 이차 쓰레드
int monitorTemp()
{
while(true)
{
deg = getTemp(); // 온도 측정 후 온도값을 갱신함
}
...
}
이때 deg의 타입을 double로만 하면, 최적화에 목숨거는 컴파일러는 이렇게 바꾸기도 한답니다. 메인프로그램 부분이 어떻게 바뀌나 봐 주세요.
double deg=20; // deg는 센서가 보내주는 값
register_A__ = deg; // register_A__는 임의의 레지스터
while(true)
{
if( register_A__ >30)
messageOut("소변 봄");
else
messageOut("소변 안 봄");
}
...
메인프로그램만 보면, deg는 처음에 한번만 초기화되어서 계속 변경되지 않으므로 레지스터에 넣고 써도 된다는 억측을 부를 수 있습니다. 따라서 위와 같이 최적화 과정을 거칩니다.
이렇게 되면, 센서로 측정한 값이 30도의 경계를 들락거리든 센서가 망가지든 하등 상관없이 "소변 안 봄"만 출력됩니다.while 루프 안에서 20의 값을 가진 레지스터 변수만 사용된다는 것입니다. 이런 일이 생길지도 모르기 때문에 deg 변수를 volatile로 선언하는 것이죠. 쉽게 말해(약간 어폐가 있을지도 모르지만), volatile 타입은 어떤 값을 항상 감시하는 경우에 사용한다고 보면 됩니다. 인터럽트 핸들러나, 메모리맵 I/O, 아니면 다중스레드 프로그래밍, 기계 제어 등에 사용합니다.
단!
여기서 "이런 일이 생길지도 모르기 때문에"란 말에 집중하셔야 합니다. 컴파일러에 따라서는 이런 최적화가 일어나지 않을 수도 있기 때문입니다. 위에서 한 제 경험담처럼, 있으나 없으나 상관없이 잘 되는 경우도 있습니다. (register 키워드를 명시적으로 써주지 않으면 레지스터 변수로 만들지 않는 것이겠지요?)
출처 : 데브피아 VC++ 게시판
파일
작성시각 2003-10-02 오후 1:02:06 조 회 수 297
글 분 류 VC++ 일반
http://www.kwak101.pe.kr/kwak101/main.html
---------------------------------------------------
*초기작성일 : 2003/03/22
*작성/저작: 곽용재(kwak101@hitel.net)
*최종수정일 : 2003/08/11
*수정에 도움 주신분:
- 강기현(testors@phantagram.com) 님
---------------------------------------------------
* volatile 이란?
말 그대로 따지면, "그 변수를 휘발성 메모리에 만들어라"라는 뜻입니다.
일반적으로 컴퓨터 분야에서 '휘발성(volatileness) 메모리'라고 하면, 전원을 끄면 데이터가 날아가는 메모리란 뜻을 의미합니다. 한데, 웃기죠? 우리가 사용하는 컴퓨터는 전원을 끄면 데이터가 모두 날아간단 말씀입니다. (물론 배터리 백업이 되는 S-RAM이나 반영구 저장이 가능한 플래쉬메모리 이야기는 제외합니다. 대부분 이들 메모리는 데이터 저장용으로만 쓰니까요.)
제가 10여년 전 C를 처음 공부하고 쓸 때, volatile이란 키워드는 register 키워드와 반대로 생각하라고 저는 배웠습니다. 즉, volatile로 선언한 변수는 절대로 레지스터 변수(register 키워드가 붙은 변수)로 만들어지지 않습니다.
그렇다면, 레지스터 변수에 대해 아셔야 겠죠? 레지스터 변수는 말 그대로 CPU가 사용하는 임시 저장용 고속 메모리인 레지스터를 저장 영역으로 사용하는 변수입니다. 요즘 나오는 컴파일러는 꽤 똑똑해서, 굳이 register라고 선언하지 않아도 빠른 데이터 교환이 필요한 코드에 사용되는 변수는 레지스터 변수로 바꿔줍니다.
예를 들어, 양변기 수온을 재는 센서(둔감한 센서)를 컴퓨터에 물리고, 이 센서가 측정한 값이 30도를 넘으면 누군가가 소변을 본다고 알려주고, 30도 아래이면 아무도 없음을 알려주는 코드를 작성한다고 합시다. 어떤 온도값을 담는 전역변수를 두고(뭐 간단하게 짜려고 하니까...^^) 메인 프로그램은 무한루프를 돌면서 어떤 온도값에 따라 적절한 메시지를 출력하고, 이차스레드는 역시 무한루프를 돌면서 끊임없이 이 센서의 측정값을 감시해서 온도값을 갱신합니다. (무지하게 비효율적인 코드이지만, 어쨌든...^^;)
// 메인 프로그램
...
double deg=20; // deg는 센서가 보내준 값
while(true)
{
if( deg>30)
messageOut("소변 봄");
else
messageOut("소변 안 봄");
}
...
// 이차 쓰레드
int monitorTemp()
{
while(true)
{
deg = getTemp(); // 온도 측정 후 온도값을 갱신함
}
...
}
이때 deg의 타입을 double로만 하면, 최적화에 목숨거는 컴파일러는 이렇게 바꾸기도 한답니다. 메인프로그램 부분이 어떻게 바뀌나 봐 주세요.
double deg=20; // deg는 센서가 보내주는 값
register_A__ = deg; // register_A__는 임의의 레지스터
while(true)
{
if( register_A__ >30)
messageOut("소변 봄");
else
messageOut("소변 안 봄");
}
...
메인프로그램만 보면, deg는 처음에 한번만 초기화되어서 계속 변경되지 않으므로 레지스터에 넣고 써도 된다는 억측을 부를 수 있습니다. 따라서 위와 같이 최적화 과정을 거칩니다.
이렇게 되면, 센서로 측정한 값이 30도의 경계를 들락거리든 센서가 망가지든 하등 상관없이 "소변 안 봄"만 출력됩니다.while 루프 안에서 20의 값을 가진 레지스터 변수만 사용된다는 것입니다. 이런 일이 생길지도 모르기 때문에 deg 변수를 volatile로 선언하는 것이죠. 쉽게 말해(약간 어폐가 있을지도 모르지만), volatile 타입은 어떤 값을 항상 감시하는 경우에 사용한다고 보면 됩니다. 인터럽트 핸들러나, 메모리맵 I/O, 아니면 다중스레드 프로그래밍, 기계 제어 등에 사용합니다.
단!
여기서 "이런 일이 생길지도 모르기 때문에"란 말에 집중하셔야 합니다. 컴파일러에 따라서는 이런 최적화가 일어나지 않을 수도 있기 때문입니다. 위에서 한 제 경험담처럼, 있으나 없으나 상관없이 잘 되는 경우도 있습니다. (register 키워드를 명시적으로 써주지 않으면 레지스터 변수로 만들지 않는 것이겠지요?)
출처 : 데브피아 VC++ 게시판
트랙백
댓글
글
Technical Article 2004. 11. 29. 15:34GDI+ 리소스에서 이미지 긁어오기~
1. ICON 사용
HICON hIcon = LoadIcon(NULL, IDI_APPLICATION);
Bitmap bitmap(hIcon);
CDC *pDC = GetDlgItem(IDC_STATIC_OOPS)->GetDC();
Graphics graph(pDC->m_hDC);
graph.DrawImage(bitmap, 1, 1);
2. JPEG 사용
리소스에 Data 분류로 집어넣으면 BMP로 변환되면서 바로 쓸수 있다.
Bitmap *bitmap = Bitmap::FromResource(AfxGetApp()->m_hInstance, MAKEINTRESOURCEW(IDR_DATA2));
CDC *pDC = GetDlgItem(IDC_STATIC_OOPS)->GetDC();
Graphics graph(pDC->m_hDC);
graph.DrawImage(bitmap, 1, 1);
HICON hIcon = LoadIcon(NULL, IDI_APPLICATION);
Bitmap bitmap(hIcon);
CDC *pDC = GetDlgItem(IDC_STATIC_OOPS)->GetDC();
Graphics graph(pDC->m_hDC);
graph.DrawImage(bitmap, 1, 1);
2. JPEG 사용
리소스에 Data 분류로 집어넣으면 BMP로 변환되면서 바로 쓸수 있다.
Bitmap *bitmap = Bitmap::FromResource(AfxGetApp()->m_hInstance, MAKEINTRESOURCEW(IDR_DATA2));
CDC *pDC = GetDlgItem(IDC_STATIC_OOPS)->GetDC();
Graphics graph(pDC->m_hDC);
graph.DrawImage(bitmap, 1, 1);
트랙백
댓글
글
Technical Article 2004. 11. 29. 11:22GDI+를 사용해 BoA요~ (PNG출력까지~)
셋팅~~~~
1. Platform SDK를 받는다.
http://www.microsoft.com/msdownload/platformsdk/sdkupdate/
상단 메뉴에 Downloads->Install...
Core SDK에 Build environment, Documentation, Sample and source code선택한다(다해도 되고 필요한거만 해도 되고...알아서..)
DLL은
http://www.microsoft.com/downloads/details.aspx?FamilyID=6a63ab9c-df12-4d41-933c-be590feaa05a&DisplayLang=en
문서명 : Platform SDK Redistributable: GDI+
파일명 : gdiplus_dnld.exe
이거 받아서 windows밑에 system32에 복사한다.
2. 대략 오래기다리면 C:Program FilesMicrosoft SDK에 설치가 끝난다.
3. Visual Studio 6에서 Tools-Options-Directories 에서
Include = C:PROGRAM FILESMICROSOFT SDKINCLUDE
Libray = C:PROGRAM FILESMICROSOFT SDKLIB
를 추가해서 최상단으로 옮겨준다.
이까지는 비졀스튜디오에서 셋팅해야할꺼고....
이후부터는 프로젝트단위 셋팅...
4. Project-Settings에서 Link탭-Object/Library Modules에
gdiplus.lib추가(Debug/Release 다~ 안하면 즐)
5. 삐리리App클래스.h
ULONG_PTR m_pGDIPlus; 추가
6. 삐리리App클래스.cpp에서...
6-1. InitInstance() 오버라이딩
GdiplusStartupInput gdiplusStartupInput;
GdiplusStartup(&m_pGDIPlus, &gdiplusStartupInput, NULL);
추가
6-2. ExitInstance() 오버라이딩
GdiplusShutdown(m_pGDIPlus);
추가
7. StdAfx.h에
#include
using namespace Gdiplus;
추가
<참조> 데브피아 어떤분 ..;
이미지 출력하기~~~~ 뚜둥
Image imgT(L"test.png");
CDC *pDC = GetDlgItem(IDC_STATIC_IMG)->GetDC();
Graphics graph(pDC->m_hDC);
graph.DrawImage(&imgT, Point(0,0));
이딴식으로....
다른방법....
1. Platform SDK를 받는다.
http://www.microsoft.com/msdownload/platformsdk/sdkupdate/
상단 메뉴에 Downloads->Install...
Core SDK에 Build environment, Documentation, Sample and source code선택한다(다해도 되고 필요한거만 해도 되고...알아서..)
DLL은
http://www.microsoft.com/downloads/details.aspx?FamilyID=6a63ab9c-df12-4d41-933c-be590feaa05a&DisplayLang=en
문서명 : Platform SDK Redistributable: GDI+
파일명 : gdiplus_dnld.exe
이거 받아서 windows밑에 system32에 복사한다.
2. 대략 오래기다리면 C:Program FilesMicrosoft SDK에 설치가 끝난다.
3. Visual Studio 6에서 Tools-Options-Directories 에서
Include = C:PROGRAM FILESMICROSOFT SDKINCLUDE
Libray = C:PROGRAM FILESMICROSOFT SDKLIB
를 추가해서 최상단으로 옮겨준다.
이까지는 비졀스튜디오에서 셋팅해야할꺼고....
이후부터는 프로젝트단위 셋팅...
4. Project-Settings에서 Link탭-Object/Library Modules에
gdiplus.lib추가(Debug/Release 다~ 안하면 즐)
5. 삐리리App클래스.h
ULONG_PTR m_pGDIPlus; 추가
6. 삐리리App클래스.cpp에서...
6-1. InitInstance() 오버라이딩
GdiplusStartupInput gdiplusStartupInput;
GdiplusStartup(&m_pGDIPlus, &gdiplusStartupInput, NULL);
추가
6-2. ExitInstance() 오버라이딩
GdiplusShutdown(m_pGDIPlus);
추가
7. StdAfx.h에
#include
using namespace Gdiplus;
추가
<참조> 데브피아 어떤분 ..;
이미지 출력하기~~~~ 뚜둥
Image imgT(L"test.png");
CDC *pDC = GetDlgItem(IDC_STATIC_IMG)->GetDC();
Graphics graph(pDC->m_hDC);
graph.DrawImage(&imgT, Point(0,0));
이딴식으로....
다른방법....
트랙백
댓글
글
Technical Article/펌 2004. 11. 26. 15:56The Groovyness of the Gallery
http://www.codeproject.com/tips/vcgallery.asp
Introduction
Sometimes, gentle reader, you may wish to use the same code in many projects (an honorable and just practice) and for reasons best left to yourself you choose not to partake in the creation of lib files and dll’s.
In fact many programmers choose to create a directory and dump classes (the .h and cpp files), which they think they may use often, and then add the relevant paths to VC++ (Tools->Options->Directories then setting the relevant include and source directories as necessary). Moreover other programmers like to simply dump a copy of the .h an .cpp files into the project folder they want to use it in and work from there. And still others yet like to use the Gallery to create ogx files. The purpose of this article then, gentle reader, is to elucidate as to how to take advantage of the Gallery.
A Beginning
Suppose my friend, you have created a most excellent class that you believe you will want to use in another project. You don’t wish to use dll’s or lib files. Perhaps each time you need to use it some minor modification may be necessary or perhaps even you dear reader just simply want access to the source code in the project without having to go dropping copies of the source code around into folders.
A very lithesome ion to this problem is provided by using the Gallery. According to the help files provided by Microsoft™…
The Gallery provides a convenient way to add complex code such as components and ActiveX controls to your project, or to let you reuse previously written code.”
But how do we add our class(es) to this magical Gallery?
Simple my good friend – follow this gentle procedure.
Open the project in which the class of interest already exists.
Open the Workspace (View Menu->Wordspace, or ALT-0)
Click on the root node of the Tree (in this case “MyCoolApp classes”) and there will now be a list of the classes in the application (see below).
Click on the class of interest (in this case we will use “CMyGroovyClass” and from the menu displayed choose “Add to Gallery”).
This will now create a nice sparkly new folder in something like “C:\Program Files\Microsoft Visual Studio\Common\MSDEV98\Gallery” (depending on where you have VC++ installed). The folder will have the same name as the project (in this case “MyCoolApp”) and inside this folder will be a .ogx file with the same name as your class (in this case it will be My Groovy Class.ogx (see below)
You can share this file with others if you wish. To use it, all they need to do is either create a similar sub-folder in the Gallery folder and place the .ogx file into that, or they can drop the file into “Visual C++ Components” folder (Although it is probably best if they create a new folder).
Now what?
Now you have added your class to the Gallery, you are now free to use it in other projects with little effort to you dear reader.
How do I use it?
Open the project you want to add the class to (or start a new project).
Open the Gallery (Project Menu-> Add to Project->Components and Controls)
From the “Components and Controls Gallery” window that appears, select the folder that holds the .ogx (in this case MyCoolApp).
Then either double click the .ogx file, or select the .ogx file then click “Insert”, you will now be prompted with the following dialog:
Click “OK”, then close the “Components and Controls Gallery” window. The class will now be inserted into your project (just like magic but better).
Having passed on my wisdom I am now free to go about my daily business as too are you my dear reader. I hope this has been enlightening and wish you happiness and heartiness on your quest for perfect programming
An additional pointer to you all in your journey - You can also add ActiveX controls or third party components to your projects. Read the MSDN help files for information on how to do this and for more information on .ogx files.
Here-in ends the lesson.
Introduction
Sometimes, gentle reader, you may wish to use the same code in many projects (an honorable and just practice) and for reasons best left to yourself you choose not to partake in the creation of lib files and dll’s.
In fact many programmers choose to create a directory and dump classes (the .h and cpp files), which they think they may use often, and then add the relevant paths to VC++ (Tools->Options->Directories then setting the relevant include and source directories as necessary). Moreover other programmers like to simply dump a copy of the .h an .cpp files into the project folder they want to use it in and work from there. And still others yet like to use the Gallery to create ogx files. The purpose of this article then, gentle reader, is to elucidate as to how to take advantage of the Gallery.
A Beginning
Suppose my friend, you have created a most excellent class that you believe you will want to use in another project. You don’t wish to use dll’s or lib files. Perhaps each time you need to use it some minor modification may be necessary or perhaps even you dear reader just simply want access to the source code in the project without having to go dropping copies of the source code around into folders.
A very lithesome ion to this problem is provided by using the Gallery. According to the help files provided by Microsoft™…
The Gallery provides a convenient way to add complex code such as components and ActiveX controls to your project, or to let you reuse previously written code.”
But how do we add our class(es) to this magical Gallery?
Simple my good friend – follow this gentle procedure.
Open the project in which the class of interest already exists.
Open the Workspace (View Menu->Wordspace, or ALT-0)
Click on the root node of the Tree (in this case “MyCoolApp classes”) and there will now be a list of the classes in the application (see below).
Click on the class of interest (in this case we will use “CMyGroovyClass” and from the menu displayed choose “Add to Gallery”).
This will now create a nice sparkly new folder in something like “C:\Program Files\Microsoft Visual Studio\Common\MSDEV98\Gallery” (depending on where you have VC++ installed). The folder will have the same name as the project (in this case “MyCoolApp”) and inside this folder will be a .ogx file with the same name as your class (in this case it will be My Groovy Class.ogx (see below)
You can share this file with others if you wish. To use it, all they need to do is either create a similar sub-folder in the Gallery folder and place the .ogx file into that, or they can drop the file into “Visual C++ Components” folder (Although it is probably best if they create a new folder).
Now what?
Now you have added your class to the Gallery, you are now free to use it in other projects with little effort to you dear reader.
How do I use it?
Open the project you want to add the class to (or start a new project).
Open the Gallery (Project Menu-> Add to Project->Components and Controls)
From the “Components and Controls Gallery” window that appears, select the folder that holds the .ogx (in this case MyCoolApp).
Then either double click the .ogx file, or select the .ogx file then click “Insert”, you will now be prompted with the following dialog:
Click “OK”, then close the “Components and Controls Gallery” window. The class will now be inserted into your project (just like magic but better).
Having passed on my wisdom I am now free to go about my daily business as too are you my dear reader. I hope this has been enlightening and wish you happiness and heartiness on your quest for perfect programming
An additional pointer to you all in your journey - You can also add ActiveX controls or third party components to your projects. Read the MSDN help files for information on how to do this and for more information on .ogx files.
Here-in ends the lesson.
트랙백
댓글
보호글
Technical Article/펌 2004. 11. 22. 01:13접속자수 이상해지는거~~ volatile
보호되어 있는 글입니다.
내용을 보시려면 비밀번호를 입력해주세요.
글
Technical Article/펌 2004. 10. 24. 20:34[펌] 디버깅과 탐정 놀이
SW 엔지니어로서, 디버깅은 사실 탐정놀음과 비슷합니다. 어디가 원인인지 찾아내는
게임...
디버깅 기법을 탐정들의 스타일에 따라 분류해 봤습니다.
- 하드보일드형
모든 문장과 문장 사이에 printf를 추가한다.
어떤 문장이 문제를 일으키는지 끈기 있게 추적한다.
한줄씩 따라가다보면 문제가 되는 문장을 찾을 수 있기 마련이다.
가끔 담배를 피우러 나가는 것을 잊지 않는다.
잠은 사무실에서 아무렇게나 자는 편이 좋다.
- 안락의자형
가만히 앉아서 모니터를 뚫어져라 응시한다.
전혀 움직이지 않고 몇시간이고 코드를 쳐다본다.
가끔 혼자서 뭐라고 중얼중얼 거리기도 하는데 옆사람은 못알아 듣는다.
그러나 갑자기 마구 타이핑을 하더니 버그를 잡아낸다.
다 좋은데 옆에서 보기엔 미친것 같다.
- 완전범죄형
프로그램을 짤 때 부터 애시당초 머리속으로 무척 많은 생각을 한다.
코드 한줄 한줄 마다 모든 부가효과(side effect), 예외상황(exception), 잘못된 입력
을 염두에 둔다.
심지어 멀티 슬레드 코드로 사용되는 경우도 생각하고, 에러 리턴 코드도 구조적으로
만든다.
버그없는 코드는 완전범죄만큼이나 불가능 하다.
결국엔 항상 사소한 것에서 문제가 발생한다.
- CSI 과학수사대형
소스 디버거의 브레이크 포인트는 기본이다. 조건부 브레이크-포인트는 물론이요 스
택 트레이스를 한다.
퓨리파이어 같은 소프트웨어로 메모리 leakage도 검사한다.
gprof나 VC-profiler로 프로그램의 병목도 찾아낸다. spi++같은 것도 능숙하게 사용한
다.
다른 사람보다 항상 제일 늦게 디버깅을 마친다.
- 미스 마플형
엔지니어들이 디버깅하다 안되서 휴게실에 나가 담배를 태운다.
이런저런 문제점들에 대해 논의를 하고 있는데 옆에서 쓰레기통 비우던 아줌마가 말한
다.
"그럴땐 대게 클래스 destructor에서 널 포인트를 지우는 바람에 그렇게 되는데..."
- 명탐정 코난형
디버깅을 시작한다.
어려운 코드를 들여다 보니 잠만온다.
일어나면 코드가 디버깅 되어 있다.
옆에서 네이버 지식인을 습격하고 있는 초딩이 의심스럽다.
- 소년탐정 김전일형
버그의 원인이 될만한 모듈을 고립시킨다.
코드를 고치려다 버그가 하나 더 발생한다.
버그가 하나 더 발생한다.
버그가 하나 더 발생한다.
이건 연쇄 버그다.
시스템이 크래쉬 한다.
....어쨌거나 버그는 이 안에 있다.
http://hongsup.egloos.com/322620
게임...
디버깅 기법을 탐정들의 스타일에 따라 분류해 봤습니다.
- 하드보일드형
모든 문장과 문장 사이에 printf를 추가한다.
어떤 문장이 문제를 일으키는지 끈기 있게 추적한다.
한줄씩 따라가다보면 문제가 되는 문장을 찾을 수 있기 마련이다.
가끔 담배를 피우러 나가는 것을 잊지 않는다.
잠은 사무실에서 아무렇게나 자는 편이 좋다.
- 안락의자형
가만히 앉아서 모니터를 뚫어져라 응시한다.
전혀 움직이지 않고 몇시간이고 코드를 쳐다본다.
가끔 혼자서 뭐라고 중얼중얼 거리기도 하는데 옆사람은 못알아 듣는다.
그러나 갑자기 마구 타이핑을 하더니 버그를 잡아낸다.
다 좋은데 옆에서 보기엔 미친것 같다.
- 완전범죄형
프로그램을 짤 때 부터 애시당초 머리속으로 무척 많은 생각을 한다.
코드 한줄 한줄 마다 모든 부가효과(side effect), 예외상황(exception), 잘못된 입력
을 염두에 둔다.
심지어 멀티 슬레드 코드로 사용되는 경우도 생각하고, 에러 리턴 코드도 구조적으로
만든다.
버그없는 코드는 완전범죄만큼이나 불가능 하다.
결국엔 항상 사소한 것에서 문제가 발생한다.
- CSI 과학수사대형
소스 디버거의 브레이크 포인트는 기본이다. 조건부 브레이크-포인트는 물론이요 스
택 트레이스를 한다.
퓨리파이어 같은 소프트웨어로 메모리 leakage도 검사한다.
gprof나 VC-profiler로 프로그램의 병목도 찾아낸다. spi++같은 것도 능숙하게 사용한
다.
다른 사람보다 항상 제일 늦게 디버깅을 마친다.
- 미스 마플형
엔지니어들이 디버깅하다 안되서 휴게실에 나가 담배를 태운다.
이런저런 문제점들에 대해 논의를 하고 있는데 옆에서 쓰레기통 비우던 아줌마가 말한
다.
"그럴땐 대게 클래스 destructor에서 널 포인트를 지우는 바람에 그렇게 되는데..."
- 명탐정 코난형
디버깅을 시작한다.
어려운 코드를 들여다 보니 잠만온다.
일어나면 코드가 디버깅 되어 있다.
옆에서 네이버 지식인을 습격하고 있는 초딩이 의심스럽다.
- 소년탐정 김전일형
버그의 원인이 될만한 모듈을 고립시킨다.
코드를 고치려다 버그가 하나 더 발생한다.
버그가 하나 더 발생한다.
버그가 하나 더 발생한다.
이건 연쇄 버그다.
시스템이 크래쉬 한다.
....어쨌거나 버그는 이 안에 있다.
http://hongsup.egloos.com/322620
RECENT COMMENT