'취미생활 > 일상다반사' 카테고리의 다른 글
| 일상의 아이디어, 팩음료 쉽게 잘 마시는 빨대 튜닝 방법 (0) | 2017.06.15 |
|---|---|
| 내가 생각하는 대학원생 이상형 (0) | 2017.01.12 |
| 1주일에 1권씩 읽기, 1년에 52권 (2011) (0) | 2011.05.23 |
| even though 와 even if 의 차이점 (0) | 2010.09.29 |
| 유시민 항소이유서 전문 (0) | 2010.06.01 |
| 일상의 아이디어, 팩음료 쉽게 잘 마시는 빨대 튜닝 방법 (0) | 2017.06.15 |
|---|---|
| 내가 생각하는 대학원생 이상형 (0) | 2017.01.12 |
| 1주일에 1권씩 읽기, 1년에 52권 (2011) (0) | 2011.05.23 |
| even though 와 even if 의 차이점 (0) | 2010.09.29 |
| 유시민 항소이유서 전문 (0) | 2010.06.01 |
네트워크 TCP성능 관련,Socket Option으로 튜닝하기
http://nostalgia76.tistory.com/entry/AIX-TCP-%EB%B0%8F-UDP-%EC%84%B1%EB%8A%A5-%EC%A1%B0%EC%A0%95
http://cafe.naver.com/fmtrade7/239
http://cafe.naver.com/cyberzone/648
| netstat -at 네트워크 상태 알아보기 명령어 (0) | 2017.05.17 |
|---|---|
| 리눅스 개발 및 커널 이야기 (0) | 2017.01.12 |
| 라즈베리파이 2b 세팅 (0) | 2015.07.06 |
| MFC MDI SDI 설명 및 팁 (0) | 2013.07.09 |
| MFC 분할윈도우만들기 및 Tip (0) | 2013.07.06 |
1. OS설치(라즈비안 받아서 Win32DiskImager로 4GB SD에 넣고
2. 부팅후 세팅(SSH enable, passwd등등)
3. 계정생성(groups보고 그대로 adduser)
4. pi계정 삭제(deluser)
5. 자동로그인 설정(/etc/inittab) 이거하면서 주석처리하려고 #을 누르니 키보드 설정이 다른지 \이 #이었음)
라즈베리파이
라즈베리파이 운영체제 설치 및 파일 서버 만들기(설정 처음사용시 따라할 것)
라즈베리파이 자동로그인(따라해보자 이것저것 글타래 따라가보기)
http://blog.daum.net/hevyflat/35
원격SSH 사용관련
http://kocoafab.cc/tutorial/view/314
사운드설정
http://kocoafab.cc/tutorial/view/340
Audio out을 USB Audio out으로 세팅
(I2S DAC사용안하고 일반 DAC에 USB input으로 연결하고 싶은데 이 세팅하면 되는가?)
DAC의 LAN port에 I2S라고 써있던데 LANport로 I2S out세팅은 가능한지 궁금함
http://plugable.com/2014/11/06/how-to-switch-to-usb-audio-on-raspberry-pi
Volumio : DLNA 서버의 가동.
(BubbleUPnP에서 스마트폰음원을 스트리밍 Volumio플레이어는 기본으로 되었음)
(Volumio의 USB등의 파일을 BubbleUPnP로 play하기 위해 세팅이 필요)
http://egloos.zum.com/nemonein/v/5267631
라즈베리파이 부팅, 무선랜 설정
라즈베리파이 N100mini 설정
| 리눅스 개발 및 커널 이야기 (0) | 2017.01.12 |
|---|---|
| 네트워크프로그래밍 (0) | 2016.07.08 |
| MFC MDI SDI 설명 및 팁 (0) | 2013.07.09 |
| MFC 분할윈도우만들기 및 Tip (0) | 2013.07.06 |
| Virtual Serial Port Emulator (0) | 2013.07.06 |
chrome프로그램의 속성값에서
대상 값을
"C:\Program Files\Google\Chrome\Application\chrome.exe" --no-sandbox
으로 변경한다.
| 컴퓨터 PC로 문자보내기 (유플러스 홈페이지 바뀌어서 겨우 찾음) (3) | 2017.05.17 |
|---|---|
| 데이터 완전 삭제, 로우 레벨 포맷(Low Level Format) 하는 방법 (12) | 2017.05.17 |
| inline 을 많이 쓰자 작은 함수라면 장점많고, 단점적고 (0) | 2012.03.22 |
| Windows7 tweak 바로가기 만들기 ㄷㄷㄷ (0) | 2011.03.25 |
| Video 관련 유틸 무료제공 (0) | 2011.03.13 |
등록된 DocTemplate가 여러개일 경우 NEW_FILE을 하게 되면 다이얼로그가 떠서 등록된 템플릿중에 하나를 골라 새 윈도우를 생성하게 된다. 그런데 이때 리소스쪽에 몇가지 작업(스트링 테이블에 CNewTypeDlg를 위한 문자열)을 하지 않으면 인식되지않아 첫번째로 등록된 문서템플릿에 해당하는 문서만 새로 생성되는 것을 볼 수 있다. 반드시 해야 되는것은
이고 부가적으로 별도의 메뉴를 유지 하려면 엑셀레이터, 아이콘을 해주어야 한다.
왜 스트링 테이블에 CNewTypeDlg를 위한 문자열을 삽입하지 않으면 안되는 이유는 ID_FILE_NEW의 COMMAND가 CWinApp에 전달되어 CWinApp::OnFileNew()가 호출된다고 가정하면 아래와 같은 코드가 실행이 된다.
CDocManager::OnFileNew()
{
CDocTemplate* pTemplate = (CDocTemplate*)m_templateList.GetHead();
if (m_templateList.GetCount() > 1)
{
// more than one document template to choose from
// bring up dialog prompting user
CNewTypeDlg dlg(&m_templateList);
INT_PTR nID = dlg.DoModal();
if (nID == IDOK)
pTemplate = dlg.m_pSelectedTemplate;
else
return; // none - cancel operation
}
}
가 실행되는데 이때 등록된 문서템플릿이 1개 이상이면 CNewTypeDlg의 다이얼로그가 보이게 된다. 근데 이때 CNewTypeDlg코드에서는 스트링 테이블의 문자열에서 템플릿에 대한 정보를 가져오게 되는데 못가져오면 다이얼로그의 리스트박스에 삽입하지 못하게 되고 2개인데 하나가 실패되면 등록되어 있는 템플릿만 새로 생성되게 되는 것이다. 그것을 판단하는 CNewTypeDlg::InitDialog()이다.
POSITION pos = m_pList->GetHeadPosition();
// add all the CDocTemplates in the list by name
while (pos != NULL)
{
CDocTemplate* pTemplate = (CDocTemplate*)m_pList->GetNext(pos);
ASSERT_KINDOF(CDocTemplate, pTemplate);
CString strTypeName;
if (pTemplate->GetDocString(strTypeName, CDocTemplate::fileNewName) &&
!strTypeName.IsEmpty()) // 문자열로 판단한다.
{
// add it to the listbox
int nIndex = pListBox->AddString(strTypeName);
if (nIndex == -1)
{
EndDialog(-1);
return FALSE;
}
pListBox->SetItemDataPtr(nIndex, pTemplate);
}
}
리소스에 등록된 문자열은 '\n'으로 구분되는 것으로 순서대로 아래 enum값의 의미를 가진다.
enum DocStringIndex
{
windowTitle, // default window title
docName, // user visible name for default document
fileNewName, // user visible name for FileNew
// for file based documents:
filterName, // user visible name for FileOpen
filterExt, // user visible extension for FileOpen
// for file based documents with Shell open support:
regFileTypeId, // REGEDIT visible registered file type identifier
regFileTypeName, // Shell visible registered file type name
};
따라서 이에 맞게 스트링테이블의 문서템플릿정보를 추가해야 한다.
| Document | GetFirstViewPosition 및 GetNextView를 사용하여 문서의 뷰 목록에 액세스합니다. GetDocTemplate를 호출하여 문서 템플릿에 액세스합니다. |
| View | GetDocument를 호출하여 해당 문서에 액세스합니다,GetParentFrame을 호출하여 해당 프레임 창에 액세스합니다. |
| Signle Frame Window | GetActiveView를 호출하여 현재 뷰에 액세스합니다,GetActiveDocument를 호출하여 현재 뷰에 연결된 문서에 액세스합니다. |
| MDI Frame Window | MDIGetActive를 호출하여 현재 활성화된 CMDIChildWnd에 액세스합니다. |
| Application | CWinApp * pApp = (CWinApp*)AfxGetApp(); |
| MainFrame | CMainFrame * pFrame = (CMainFrame *)AfxGetMainWnd(); |
| Document | CMainFrame * pFrame = (CMainFrame *)AfxGetMainWnd();, CDocument *pDoc = CDocument *)pFrame->GetActiveDocument(); |
| View | CMainFrame * pFrame = (CMainFrame *)AfxGetMainWnd();, CView *pView = (CView *)pFrame->GetActiveView(); |
| Application | CWinApp *pApp = (CWinApp*)AfxGetApp(); |
| MainFrame | CMainFrame *pFrame = (CMainFrame *)AfxGetMainWnd(); |
| ChildFrame | CMainFrame *pFrame = (CMainFrame *)AfxGetMainWnd();, CChildFrame *pChild = (CChildFrame *)pFrame->GetActiveFrame(); |
| Document | CMainFrame *pFrame = (CMainFrame *)AfxGetMainWnd();, CChildFrame *pChild = (CChildFrame *)pFrame->GetActiveFrame();, CDocument *pDoc = CDocument *)pChild->GetActiveDocument(); |
| View | CMainFrame *pFrame = (CMainFrame *)AfxGetMainWnd();, CChildFrame *pChild = (CChildFrame *)pFrame->GetActiveFrame();, CView *pView = (CView *)pChild->GetActiveView(); |
// Document header file
class CMyDoc : public CDocument
{
public:
static CMyDoc * GetDoc();
};
CMyDoc * CMyDoc::GetDoc()
{
CFrameWnd * pFrame = (CFrameWnd *)(AfxGetApp()->m_pMainWnd);
return (CMyDoc *) pFrame->GetActiveDocument();
}
{
CMDIChildWnd * pChild =
((CMDIFrameWnd*)(AfxGetApp()->m_pMainWnd))->MDIGetActive();
if ( !pChild )
return NULL;
CDocument * pDoc = pChild->GetActiveDocument();
if ( !pDoc )
return NULL;
// Fail if doc is of wrong kind
if ( ! pDoc->IsKindOf( RUNTIME_CLASS(CMyDoc) ) )
return NULL;
return (CMyDoc *) pDoc;
}
class CMyView
{
...
public:
static CMyView * GetView();
...
};
CMyView * CMyView::GetView()
{
CFrameWnd * pFrame = (CFrameWnd *)(AfxGetApp()->m_pMainWnd);
CView * pView = pFrame->GetActiveView();
if ( !pView )
return NULL;
// Fail if view is of wrong kind
// (this could occur with splitter windows, or additional
// views on a single document
if ( ! pView->IsKindOf( RUNTIME_CLASS(CMyView) ) )
return NULL;
return (CMyView *) pView;
}
CMyView * CMyView::GetView()
{
CMDIChildWnd * pChild =
((CMDIFrameWnd*)(AfxGetApp()->m_pMainWnd))->MDIGetActive();
if ( !pChild )
return NULL;
CView * pView = pChild->GetActiveView();
if ( !pView )
return NULL;
// Fail if view is of wrong kind
if ( ! pView->IsKindOf( RUNTIME_CLASS(CMyView) ) )
return NULL;
return (CMyView *) pView;
}
CMyView::GetView();
AddDocTemplate를 통하여 여러개의 DocTemplate를 등록한 경우 아래와 같은 코드를 통하여 순회가능하다.
POSITION doctempPos = GetFirstDocTemplatePosition();
while (doctempPos)
{
CDocTemplate* doctemp = GetNextDocTemplate(doctempPos);
POSITION docPos = doctemp->GetFirstDocPosition();
while (doctemp && docPos)
{
CDocument *doc = doctemp->GetNextDoc(docPos);
POSITION viewPos = doc->GetFirstViewPosition();
while (doc && viewPos)
{
CView* view = doc->GetNextView(viewPos);
view->GetParentFrame()->ActivateFrame(SW_SHOW); // 순차적으로 활성화
}
}
CString doctempStr;
doctemp->GetDocString(doctempStr, CDocTemplate::docName);
TRACE("CDocTemplate name: %s\n", doctempStr);
}
AddDocTemplate( new CMultiDocTemplate( IDR_SCRIBTYPE,
RUNTIME_CLASS( CScribDoc ),
RUNTIME_CLASS( CMDIChildWnd ),
RUNTIME_CLASS( CScribView ) ) );
CSingleDocTemplate* pDocTemplate; pDocTemplate = new CSingleDocTemplate( IDR_MAINFRAME, RUNTIME_CLASS(CTestDoc), RUNTIME_CLASS(CMainFrame), RUNTIME_CLASS(CTestView) AddDocTemplate(pDocTemplate);
CWinApp::InitInstance()에서 ProcessShellCommand()함수에서 FILE_NEW를 함으로 CmdInfo.m_nShellCommand에 CCommandLineInfo::FileNothing를 넣어준다.
if(cmdInfo.m_nShellCommand == CCommandLineInfo::FileNew )
cmdInfo.m_nShellCommand = CCommandLineInfo::FileNothing;
void CChildFrameEx::ActivateFrame(int nCmdShow)
{
// TODO: Add your specialized code here and/or call the base class
nCmdShow = SW_MAXIMIZE;
CMDIChildWnd::ActivateFrame(nCmdShow);
}MFC에서 Document, View, Frame간의 관계, MSDN
Document, View, Windows만들기, MSDN
How To Get Current CDocument or CView from Anywhere, MSDN
[출처] MFC MDI SDI|작성자 jack
| 네트워크프로그래밍 (0) | 2016.07.08 |
|---|---|
| 라즈베리파이 2b 세팅 (0) | 2015.07.06 |
| MFC 분할윈도우만들기 및 Tip (0) | 2013.07.06 |
| Virtual Serial Port Emulator (0) | 2013.07.06 |
| /etc/profile, ~/.bash_profile, ~/.bashrc, /etc/bashrc 설명 (0) | 2013.07.04 |