这个问题怎么解决
Compile error:Only public user defined types defined in public object modules can be used as parameters or return types for public procedure of class modules or as fields of public user defined types发生问题的地方
Public Property Let AllRegister(reg1 As Register)
Reg = reg1
End PropertyRegister被定义在Simulator.bas中
Public Type Instruction
Code As PCode
Param1 As Long
Param2 As Long
Param3 As Long
End Type他的意思是不是只有定义在Module中的public用户类型才能作为参数
但是我不明白的是
那个类型明明被定义在了bas Module中了啊?
谢谢大家告诉我应该怎么弄
Compile error:Only public user defined types defined in public object modules can be used as parameters or return types for public procedure of class modules or as fields of public user defined types发生问题的地方
Public Property Let AllRegister(reg1 As Register)
Reg = reg1
End PropertyRegister被定义在Simulator.bas中
Public Type Instruction
Code As PCode
Param1 As Long
Param2 As Long
Param3 As Long
End Type他的意思是不是只有定义在Module中的public用户类型才能作为参数
但是我不明白的是
那个类型明明被定义在了bas Module中了啊?
谢谢大家告诉我应该怎么弄
解决方案 »
- 字符串值大小的比较
- 搞不懂的问题,都不知道标题叫什么,进来看看再说吧,应该很简单
- 哪位朋友给推荐一下,谢谢啦
- ListView显示图标问题?
- ole 的问题
- 谁能给我一个水晶报表的教程之内的东东呀。万分感谢 EMAIL:[email protected] 有好东西相赠
- 请教个简单的问题。(急用)
- 请问如何设置TREEVIEW 和LISTVIEW控件的字体颜色!
- 用VB启动word,用什么方式或用什么命令最好?
- 我想保存Log文件!但又想能对Log文件实现查找,列表、排序等方法,(类似win2000的事件查看器)我又不想用数据库,能用文本文件实现吗?
- 请问ADODC中FIND怎样查同时符合两个条件的记录?
- vb做界面,如何实现鼠标移到Picture1时,Picture1变色
Register被定义在Simulator.bas中
Public Type Register
A As Long
B As Long
D As Long
I As Long
S As Long
F As Long
IP As Long
End Type
1.將自定義類型Register定義成類.
2.在原工程基礎上添加一個ActiveDll(即與原工程同一個工程組),這樣你就可以在這個類中定義Public的自定義類型啦,在工程裡面可用CreateObject來引用這個類.
添加一个类模块,类名为Register, 写入代码:
public A As Long
public B As Long
public D As Long
public I As Long
public S As Long
public F As Long
public IP As Long 这样你就可以定义了。通常情况下推荐此方法。3. 修改为弱引用,即向其传递一个Long地址,然后用CopyMemory进行复制,在类属性中使用这个方法比较麻烦,但效率较高。