利用Visual C++建立一个控制台程序的工程,工程的名字为TclTest。
H文件:
#include "tcl.h"
#define RET_ERR false
#define RET_OK true
#define MAX_WORD_LEN 32
int GetWordFromStr(char *pStr, char *pDestStr, int iPos);
int Tcl_EXGetWord(ClientData clientData,
Tcl_Interp *interp,
int argc, char *argv[]);
int Tcl_AppInit(Tcl_Interp *interp);
CPP文件:
#include "stdafx.h"
#include "utsample.h"
#include "memory.h"
#include "string.h"
int main(int argc, char* argv[])
{
Tcl_Main(argc, argv, Tcl_AppInit);
return 0;
}
int Tcl_EXGetWord(ClientData clientData,
Tcl_Interp *interp,
int argc, char *argv[])
{
int iPos;
bool rCode;
char pDestStr[32];
memset(pDestStr, 0, 32);