These Forums Have Moved
The Komodo forums have moved to a new home at community.komodoide.com, please head over there to post your topics!
Note that the new forums are a fresh start - you will have to register a new account.
My program is built by MFC, it have a GUI not a console window. I create a tcl interpreter by invoking Tcl_CreateInterp in my program. When use this interpreter to invoke Tcl_EvalFile, if there is "package require XXX" in the script, the interpreter will return a error "child process exited abnormally". I don't know what reason to cause this problem. Anyone can provide some suggestion? Thanks a lot!
mpTclInterp = Tcl_CreateInterp();
Tcl_FindExecutable(path);
Tcl_Init(mpTclInterp);
}
void CMyTcl::ExecScript(CString filepath)
{
int code;
const char* result;
code = Tcl_EvalFile(mpTclInterp,(char *)filepath.GetBuffer(filepath.GetLength()));
result = Tcl_GetStringResult(mpTclInterp);
CString strRst;
strRst.Format(_T("%s"),result);
if ( code != TCL_OK )
{
PostMessage(AfxGetMainWnd()->GetSafeHwnd(),ID_MSG_DEALSCRIPTERRORINFO,0,0);
AfxMessageBox(("Error:" + strRst));
}
filepath.ReleaseBuffer();
}
PS: when I firstly run program, system popup a console window with "Routing and Remote access service is starting up" and program run successfully. but I secondly run program, tcl interpreter will return a error "child process exited abnormally". Do I need to invoke some API of tcl to make some settings?