新建一個active dll
工程名改为 qhqdll
类模块名改为 qhqclass
然后再类模块中写入以下代码
option explicit
public function getstr()
msgbox "你好,欢迎你!"
end function
生成一个dll 文件,文件名为qhqdll
新建一个exe 文件
首先引用刚刚生成的dll文件(qhqdll.dll)
Private Sub Command2_Click()
dim hs as qhqdll.qhqclass
set hs = new qhqdll.qhqclass
hs.getstr
End Sub