又是COM+,各位帮帮忙

overloadma 2003-05-07 04:11:57
我的那个type lib能引用了.可是现在又有新的问题,我的组件由三个类模块组成,cstudent(multiuse),istudent(接口 pubicnotcreatable),declare(pubicnotcreatable).我把生成的dll作为组件添加到一个com+应用程序中.有两个接口._cstudent,_istudent.为什么会有两个接口?
我的客户端的声明如下:
dim istu as Istudent
set istu =new cstudent'出错:应用程序定义或模块定义错误.
要怎样声明啊?那位大哥能给个列子!谢谢啦!
...全文
65 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
overloadma 2003-05-11
  • 打赏
  • 举报
回复
组件我发过去了。
overloadma 2003-05-08
  • 打赏
  • 举报
回复
好的,可是这两天宿舍里上不了网。我是在网吧发的贴。
我把客户端的代码改为:
dim istu as Studentsvc.Istudent'Studentsvc是组件名,就是我的activex dll的工程名称。
set istu=new Studentsvc.cstudent'还是一样的错误。
还有就是我在客户端用regtlib.exe注册了我的type lib,可是运行是提示activex不能注册组件。
如果在客户端安装组件导出的*.msi的话就可以用了,可是这个安装文件拷贝到客户端的是studentsvc.dll,不是studentsvc.tlb。能不能让他拷贝过去的是studentsvc.tlb啊?


pipipig 2003-05-07
  • 打赏
  • 举报
回复
我们都很气愤,不是么?我们不能像c程序员一样光明正大的使用

像IUnKnown这样的接口,这是作为vb程序员的悲哀!

但是我们真的需要这些破接口么?需要么?

最终程序员汇聚到了一起,.net里人人平等!

但是我们真的不要要这些杂七杂八么,我们需要vb7.0!
pipipig 2003-05-07
  • 打赏
  • 举报
回复
vb使每一个类都暗含一个接口,我们虽然可以implements一个看上去像

接口的类,但vb并不了解我们的目的。包含_istudent是对的
online 2003-05-07
  • 打赏
  • 举报
回复
要不你把组件发过来,我看看
online@ourfly.com
overloadma 2003-05-07
  • 打赏
  • 举报
回复
不是啊!我用vb做的组件!
online 2003-05-07
  • 打赏
  • 举报
回复
你用vc做的吗??
online 2003-05-07
  • 打赏
  • 举报
回复
这是类模块
Public Sub GetCatalogItem(rsCatalog As ADODB.Recordset)
'Open the recordset
deOrderAccess.rsGetCatalogItem.Open

'Make it available to the client.
Set rsCatalog = deOrderAccess.rsGetCatalogItem

'Close the recordset
deOrderAccess.rsGetCatalogItem.Close
End Sub

Public Sub GetCustomers(rsCatalog As ADODB.Recordset)
'Open the recordset
deOrderAccess.rsGetCustomer.Open

'Make it available to the client.
Set rsCatalog = deOrderAccess.rsGetCustomer

'Close the recordset
deOrderAccess.rsGetCustomer.Close
End Sub

Public Sub GetOrders(rsCatalog As ADODB.Recordset)
'Open the recordset
deOrderAccess.rsGetOrders.Open

'Make it available to the client.
Set rsCatalog = deOrderAccess.rsGetOrders

'Close the recordset
deOrderAccess.rsGetOrders.Close
End Sub

online 2003-05-07
  • 打赏
  • 举报
回复
orderaccess是组件名,ordermodify是方法
Dim oOrderModify As OrderAccess.OrderModify
Private Sub Form_Load()
Set oOrderModify = New OrderAccess.OrderModify
End Sub

1,486

社区成员

发帖
与我相关
我的任务
社区描述
VB API
社区管理员
  • API
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧