=================================================================== RCS file: /home/cvs/OpenXM_contrib2/windows/asir32gui/asir32guiview.cpp,v retrieving revision 1.25 retrieving revision 1.31 diff -u -p -r1.25 -r1.31 --- OpenXM_contrib2/windows/asir32gui/asir32guiview.cpp 2012/03/10 01:09:15 1.25 +++ OpenXM_contrib2/windows/asir32gui/asir32guiview.cpp 2014/05/10 08:23:33 1.31 @@ -33,7 +33,8 @@ void loadfile(char *); void put_line(char *); void send_intr(void); void insert_to_theView(char *); -void get_rootdir(char *,int,char *); +BOOL get_rootdir(char *,int,char *); +const char *get_helpdir(); extern int bigfloat, prtime, prresult; extern char *asir_libdir; extern int asirgui_kind; @@ -377,6 +378,7 @@ void CAsir32guiView::OnChar(UINT nChar, UINT nRepCnt, // TODO: この位置にメッセージ ハンドラ用のコードを追加するかまたはデフォルトの処理を呼び出してください char *exp_result; char tmp[BUFSIZ]; + int i; if ( asirgui_kind == ASIRGUI_MESSAGE ) { Beep(); return; @@ -440,6 +442,10 @@ void CAsir32guiView::OnChar(UINT nChar, UINT nRepCnt, tmp[0] = 0; put_line(tmp); return; + case CTRL('Y'): + Paste(); return; + case CTRL('I'): + return; default : if ( nChar >= 0x20 && nChar < 0x7f ) PutChar(nChar); @@ -496,14 +502,14 @@ void CAsir32guiView::OnFileOpen() } } } + void CAsir32guiView::viewHtmlHelp(char *help) { char *helpfile; - char fmt[] = "%s\\help\\%shelp.chm"; - char root[BUFSIZ],errmsg[BUFSIZ]; - get_rootdir(root,sizeof(root),errmsg); - helpfile = (char *)malloc(sizeof(fmt) + strlen(root) + strlen(help)); - sprintf(helpfile,fmt,root,help); + char fmt[] = "%s\\%shelp.chm"; + const char *dir = get_helpdir(); + helpfile = (char *)malloc(sizeof(fmt) + strlen(dir) + strlen(help)); + sprintf(helpfile,fmt,dir,help); #if _MSC_VER < 1300 /* Visual C++ 6.0 */ ::HtmlHelp(NULL, helpfile, HH_DISPLAY_TOPIC, 0); @@ -577,7 +583,7 @@ void CAsir32guiView::UpdateMetrics() void CAsir32guiView::OnFont() { // TODO: この位置にコマンド ハンドラ用のコードを追加してください - int ret; + INT_PTR ret; LOGFONT lf; GetFont()->GetLogFont(&lf); @@ -726,22 +732,18 @@ BOOL CAsir32guiView::Create(LPCTSTR lpszClassName, LPC // TODO: この位置に固有の処理を追加するか、または基本クラスを呼び出してください BOOL ret = CWnd::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext); - FILE *fp = fopen("asirgui.hnd","w"); + FILE *fp = NULL; char *temp; + char hndname[_MAX_PATH]; - if ( fp ) { - fprintf(fp,"%d",(unsigned int)theView->m_hWnd); - fclose(fp); + if ( asirgui_kind == ASIRGUI_MAIN ) { if ( temp = getenv("TEMP") ) { - int len; - char *name; - - len = strlen(temp); - name = (char *)malloc(len+BUFSIZ); - sprintf(name,"%s\\asirgui.hnd",temp); - fopen(name,"w"); - fprintf(fp,"%d",(unsigned int)theView->m_hWnd); - fclose(fp); + sprintf(hndname,"%s\\asirgui.hnd", temp); + fp = fopen(hndname,"w"); + if ( fp ) { + fprintf(fp,"%d",(unsigned int)theView->m_hWnd); + fclose(fp); + } } } return ret;