函数OpenWindow
C++形式
LIntExport void OpenWindow(
const HTuple& Row,
const HTuple& Column,
const HTuple& Width,
const HTuple& Height,
const HTuple& FatherWindow,
const HTuple& Mode,
const HTuple& Machine,
HTuple* WindowHandle);
//参数1:窗体起始位置行位置
//参数2:窗体起始位置列位置
//参数3:窗体宽度
//参数4:窗体高度
//参数5:窗体父窗体容器Handle,无传0
//参数6:显示模式"visible"
//参数7:窗体的名称
//参数7:窗体的Handle
C#形式
public static void OpenWindow(
HTuple row,
HTuple column,
HTuple width,
HTuple height,
HTuple fatherWindow,
HTuple mode,
HTuple machine,
out HTuple windowHandle)
错误处理
错误1:HALCON error #1405: Wrong number of values of control parameter 5 in operator open_window
控制参数值的数量错误
//C#错误传参示例
HOperatorSet.OpenWindow(0, 0, 500, 500, null, "visible", "", out winHandle);
错误2:HALCON error #1305: Wrong value of control parameter 5 in operator open_window
控制参数值错误
//C#错误传参示例
参数5传了字符串,需修改为整型
HOperatorSet.OpenWindow(0, 0, 500, 500, "0", "visible", "", out winHandle);
错误3:HALCON error #5101: Error while opening the window in operator open_window
打开窗口时出错
//C#错误传参示例
//参数5传了-1,需修改为0
HOperatorSet.OpenWindow(0, 0, 500, 500, -1, "visible", "", out winHandle);
函数CloseWindow
C++形式
LIntExport void CloseWindow(
const HTuple& WindowHandle);
参数1:窗体Handle
C#形式
LIntExport void CloseWindow(const HTuple& WindowHandle);