=================================================================== RCS file: /home/cvs/OpenXM_contrib2/windows/asir32gui/asir32guiview.cpp,v retrieving revision 1.12 retrieving revision 1.20 diff -u -p -r1.12 -r1.20 --- OpenXM_contrib2/windows/asir32gui/asir32guiview.cpp 2005/05/16 00:52:48 1.12 +++ OpenXM_contrib2/windows/asir32gui/asir32guiview.cpp 2009/03/03 13:34:42 1.20 @@ -17,7 +17,7 @@ static char THIS_FILE[] = __FILE__; #endif // const TextBufferSize = 32768; -const TextBufferSize = 16384; +const int TextBufferSize = 16384; CAsir32guiView *theView; @@ -93,7 +93,6 @@ CAsir32guiView::CAsir32guiView() { // TODO: この場所に構築用のコードを追加してください。 static int tmpView_created = 0; - char errmsg[BUFSIZ]; init_input_history(); read_input_history(); @@ -203,9 +202,7 @@ void CAsir32guiView::DeleteChar(int count) { if ( count > (EndPos-CurrentPos) ) count = EndPos - CurrentPos; - if ( count == 0 ) - Beep(); - else { + if ( count > 0 ) { EndPos -= count; for ( i = CurrentPos; i < EndPos; i++ ) Buffer[i] = Buffer[i+count]; @@ -244,7 +241,7 @@ void CAsir32guiView::DeleteTop() const char *p,*q; const char *buf; char null = 0; - int len,len0,len1; + int len,len0; buf = LockBuffer(); len0 = len = strlen(buf); @@ -370,6 +367,7 @@ void CAsir32guiView::OnChar(UINT nChar, UINT nRepCnt, { // TODO: この位置にメッセージ ハンドラ用のコードを追加するかまたはデフォルトの処理を呼び出してください char *exp_result; + char tmp[BUFSIZ]; if ( asirgui_kind == ASIRGUI_MESSAGE ) { Beep(); return; @@ -430,7 +428,8 @@ void CAsir32guiView::OnChar(UINT nChar, UINT nRepCnt, case CTRL('C'): send_intr(); /* wake up the engine */ - put_line(""); + tmp[0] = 0; + put_line(tmp); return; default : if ( nChar >= 0x20 && nChar < 0x7f ) @@ -472,6 +471,7 @@ void CAsir32guiView::OnFileOpen() _chdir(prevdir); CFileDialog fileDialog(TRUE); + fileDialog.m_ofn.lpstrInitialDir = prevdir; if ( fileDialog.DoModal() == IDOK ) { CString pathName = fileDialog.GetPathName(); sprintf(cmd,"load(\"%s\");",pathName); @@ -479,10 +479,11 @@ void CAsir32guiView::OnFileOpen() if ( *p == '\\' ) *p = '/'; put_line(cmd); - p = strrchr(pathName,'\\'); + strcpy(cmd,pathName); + p = strrchr(cmd,'\\'); if ( p ) { *p = 0; - strcpy(prevdir,pathName); + strcpy(prevdir,cmd); } } } @@ -715,4 +716,30 @@ void CAsir32guiView::OnTodoparametrize() sprintf(helpfile,"%s\\help\\todo_parametrizehelp.chm",root); ::HtmlHelp(NULL, helpfile, HH_DISPLAY_TOPIC, 0); +} + +BOOL CAsir32guiView::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext) +{ + // TODO: この位置に固有の処理を追加するか、または基本クラスを呼び出してください + + BOOL ret = CWnd::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext); + FILE *fp = fopen("asirgui.hnd","w"); + char *temp; + + 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"); + fprintf(fp,"%d",(unsigned int)theView->m_hWnd); + fclose(fp); + } + } + return ret; }