例子: pclass.dll (activex dll ,类名称:class1) public function myfunction(byval i as integer) as integer myfunction= i end function
主程序调用: private sub command1_click() on error goto errorhandle: dim obj as object set obj = createobject("pclass.class1") 'pclass是dll名称,class1是pclass.dll中的类名称 '注意:不是模块名称 msgbox obj.myfunction(20) set obj = nothing exit sub errorhandle: msgbox err.description & " -- 清检查dll文件名称、类名称、是否注册等!" err.clear end sub