=================================================================== RCS file: /home/cvs/OpenXM_contrib2/windows/asir32gui/asir32guiview.cpp,v retrieving revision 1.25 retrieving revision 1.28 diff -u -p -r1.25 -r1.28 --- OpenXM_contrib2/windows/asir32gui/asir32guiview.cpp 2012/03/10 01:09:15 1.25 +++ OpenXM_contrib2/windows/asir32gui/asir32guiview.cpp 2013/08/07 07:54:16 1.28 @@ -33,7 +33,7 @@ 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 *); extern int bigfloat, prtime, prresult; extern char *asir_libdir; extern int asirgui_kind; @@ -377,6 +377,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 +441,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); @@ -577,7 +582,7 @@ void CAsir32guiView::UpdateMetrics() void CAsir32guiView::OnFont() { // TODO: この位置にコマンド ハンドラ用のコードを追加してください - int ret; + INT_PTR ret; LOGFONT lf; GetFont()->GetLogFont(&lf); @@ -726,22 +731,24 @@ 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 rootdir[BUFSIZ], errmsg[BUFSIZ], hndname[_MAX_PATH]; - if ( fp ) { - fprintf(fp,"%d",(unsigned int)theView->m_hWnd); - fclose(fp); - 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"); + if (get_rootdir(rootdir, BUFSIZ, errmsg)) { + sprintf(hndname, "%s\\bin\\asirgui.hnd", rootdir); + fp = fopen(hndname,"w"); + if ( fp ) { fprintf(fp,"%d",(unsigned int)theView->m_hWnd); fclose(fp); + } + } + if ( temp = getenv("TEMP") ) { + sprintf(hndname,"%s\\asirgui.hnd", temp); + fp = fopen(hndname,"w"); + if ( fp ) { + fprintf(fp,"%d",(unsigned int)theView->m_hWnd); + fclose(fp); } } return ret;