- 5
- 0
- 约1.86千字
- 约 3页
- 2020-02-05 发布于江苏
- 举报
如何调用DLL来加快服务器的执行速度?
1、并双击新建工程窗口中ActiveX DLL图标,VB将自动为项目添加一个类模块,并将该项目类型设置为ActiveX DLL。
2、在属性窗口将类模块的名称属性改为clsDice。
3、从工程菜单中选择工程属性,将工程名称改为MyDLL。
4、从文件菜单中选择保存clsDice,将类模块保存为myDice.cls。
5、添加以下代码:Option ExplicitPrivate Max, Point As IntegerPublic Property Get Result() As IntegerResult = PointEnd PropertyPublic Property Get Maxpoint() As IntegerMaxpoint = MaxEnd PropertyPublic Property Let Maxpoint(num As Integer)Max = numEnd PropertyPublic Sub Throw()RandomizePoint = Int(Rnd * Max) + 1End SubPrivate Sub Class_Initialize()Max = 6End Sub这个类模块定义了clsDice对象的两个属性和一个方法,这些属性和方法模拟了掷色子
原创力文档

文档评论(0)