=================================================================== RCS file: /home/cvs/OpenXM_contrib2/windows/asir32gui/asir32guiview.cpp,v retrieving revision 1.28 retrieving revision 1.30 diff -u -p -r1.28 -r1.30 --- OpenXM_contrib2/windows/asir32gui/asir32guiview.cpp 2013/08/07 07:54:16 1.28 +++ OpenXM_contrib2/windows/asir32gui/asir32guiview.cpp 2013/12/09 00:51:20 1.30 @@ -34,6 +34,7 @@ void put_line(char *); void send_intr(void); void insert_to_theView(char *); BOOL get_rootdir(char *,int,char *); +const char *get_helpdir(); extern int bigfloat, prtime, prresult; extern char *asir_libdir; extern int asirgui_kind; @@ -501,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); @@ -735,20 +736,22 @@ BOOL CAsir32guiView::Create(LPCTSTR lpszClassName, LPC char *temp; char rootdir[BUFSIZ], errmsg[BUFSIZ], hndname[_MAX_PATH]; - 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 ( asirgui_kind == ASIRGUI_MAIN ) { + 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); + 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;