使用Create Using创建的用户对象如何调用父窗口的函数?
goldg 2002-07-02 03:31:19 说明:
1、窗口中有一函数:of_test(),代码如下:
MessageBox('Test','Test')
2、已创建一Custom Visual用户对象uo_Test,uo_Test中有一按钮cb_Test,clicked事件中的代码如下:
window lw_parent
lw_parent = parent.GetParent()
if isvalid(lw_parent) then
lw_parent.Dynamic of_Test()
else
MessageBox('Error','Error')
end if
3、在窗口打开后Post执行如下代码:
Userobject luo_object
string ls_ObjectName
int li_index
li_index = 1
CHOOSE CASE li_Index
CASE 1
ls_ObjectName = 'uo_Test'
Case 2
ls_ObjectName = 'uo_test2'
END CHOOSE
luo_object = Create Using ls_ObjectName
openUserObject(luo_object)
问题:
在上述代码中,执行的是:MessageBox('Error','Error')。如何实现动态创建的对象能执行父的函数或事件?
而将3中的代码改为:
uo_test luo_object
openUsetObject(luo_object)
时能正常执行。