答案:新建一个ActiveXdll模块代码如下
public Function 弹出对话框(BYval Text as string,byval lpCaption as string) as long
msgbox text,,lpcaption
end function
窗体代码
Dim Msg as New Class
private sub form_load()
dim str as string
dim Cap as string
call msg.弹出对话框(str,cap)
end sub
首先在菜单栏.工程->引用,然后就是选择ActiveDLL 的路径,找到后就点确定就是自动添加DLL了
调用的话就用变量来调用类一样
比如:
Dim ActiveDLLTestClass As New DLLTestClass '' 注意一定要加上New语句格式为:Declare Sub 过程名Lib [ Alias " 别名]([ByVal 参数AS类型])