我想在自己实现的类中使用自定义的数据类型做属性返回。或是做类共有函数的参数及返回值。
可VB6为什么老报:only public user defined types defined in public object modules
can be used as parameters or return types for public procedures of class modules
or as field of public user defined types我都要晕了明明在数据模块我定义了共有数据类型:
Public Type CoordinatePoint
X As Double
Y As Double
End Type可还会有上面的错误报告呀!
可VB6为什么老报:only public user defined types defined in public object modules
can be used as parameters or return types for public procedures of class modules
or as field of public user defined types我都要晕了明明在数据模块我定义了共有数据类型:
Public Type CoordinatePoint
X As Double
Y As Double
End Type可还会有上面的错误报告呀!
解决方案 »
- 怎么用vb开word的新建样式和修改样式对话框 Dialogs(word常量) word常量填写什么是显示样式的对话框
- 怎样去掉MDI最大化时的动画
- 我知道表名,我怎么知道表中是否有"name"这一列,在vb中怎么能监测到啊?
- VB 中画的图如何用保存成DXF 文件用AUTOCAD编辑呢?
- 探讨字节数组和字符串之间以十六进制转换的方式和速度。
- VB有个问题
- 如何按特定规则画BMP图,然后按它要求转成二进制?请大家一起讨论。
- 小弟纯属菜鸟一只,那位老师给解释解释!!!
- 小问题,大麻烦(35分给你)
- 怎样把页面的数据上传到服务器?倾力给分!!!!
- 请问怎么才能在程序中实现这样的功能??
- [菜鸟问题]想将数量定义在Dll中,如何是好?
X As Double
Y As Double
End Type
比如Private type PointAPI
X as long:Y as long
End type定义结构体
dim Struct as PointAPI
赋值
Struct.X=100
Struct.Y=200复制到数组
dim Buffer() as byte
redim Buffer(len(Struct))
'Copymemory是API函数,要先定义[声明可以在VB的API浏览器里找到]
Copymemory byval varptr(buffer(0)),byval varptr(Struct),len(Struct)定义函数
public function Test(byref Bytes() as byte)
end function如果要还原还结构体
CopyMemory byval varptr(Struct),byval varptr(buffer(0)),len(Struct)