private void button1_Click(object sender, EventArgs e) { callBack = new eventCallBack(engineCallBack);; int ret = initEngine(@"..\grammar\tv_main.dat", "tv_main", callBack); if (ret == 0) { IntPtr temp = getVersion(); string version = Marshal.PtrToStringAnsi(temp).ToString(); this.Text = "云知声 " + version; MessageBox.Show("初始化成功!"); } else { MessageBox.Show("初始化失败!"); } }
static extern void setCallBack(eventCallBack callBack);
static extern int initEngine(string grammerPath, string tagName, eventCallBack callBack);