VB下继承VC接口生成COM组件
发布时间:2020-12-16 22:42:12 所属栏目:大数据 来源:网络整理
导读:在VB下调用VC写的COM动态库,并生产COM组件。程序很简单,只是当时写的时候因为对VB语言的不熟悉,就弄得很困难。 此处是原帖:http://topic.csdn.net/u/20110313/09/f2b56748-3cf8-4b0d-91cd-ee9035f3c130.html Public Class Css Implements laserca.ICAMenu
在VB下调用VC写的COM动态库,并生产COM组件。程序很简单,只是当时写的时候因为对VB语言的不熟悉,就弄得很困难。 此处是原帖:http://topic.csdn.net/u/20110313/09/f2b56748-3cf8-4b0d-91cd-ee9035f3c130.html Public Class Css Implements laserca.ICAMenu'接口继承 Sub AddMenu(ByRef pMenuIndex As Object,ByRef pName As String) Implements laserca.ICAMenu.AddMenu Dim myArray() As Short = {1,2} pMenuIndex = myArray pName = "ss" End Sub Sub doFunction(ByVal para As Object) Implements laserca.ICAMenu.doFunction End Sub End Class然后打开VS2005命令提示符 注册 regasm /tlb [filename] /codebase 注销 regasm /u [filename] Public Class Css Implements tlbToDll.ICAMenuUnit'接口继承 Sub getMenuPara(ByRef pMenuIndex As Object,ByRef pName As String) Implements tlbToDll.ICAMenuUnit.getMenuPara Dim myArray() As Short = {0,2} pMenuIndex = myArray pName = "ss" End Sub Sub doFunction(ByVal pWorker As Object) Implements tlbToDll.ICAMenuUnit.doFunction MsgBox(" Hello World!") End Sub End Class (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |