假若我在Server中包括以下代码:Class1中的CODEOption Explicit
Public Event SendMessage1
......
Private Sub Text1_change()
......
RaiseEvent SendMessage
End
......然后在客户方包括以下代码:
Option ExplicitPrivate WithEvents myCls as Class1Private Sub Form_Load()
Set myCls = New Class1 '???????????????????????
.......
End SubPrivate Sub myCls_SendMessage()
msgbox "Message Arive"
End Sub程序在执行时会出现错误,错误代码是80004005,看MSDN说是Remote Automation不支持WithEvents!但听说有人可以做到这一点,不知道是不是借用了其他软件。当然用DCOM是
能够做到的。但如果是在win95/win98做服务器和工作站时又怎么样配置网络呢?
Public Event SendMessage1
......
Private Sub Text1_change()
......
RaiseEvent SendMessage
End
......然后在客户方包括以下代码:
Option ExplicitPrivate WithEvents myCls as Class1Private Sub Form_Load()
Set myCls = New Class1 '???????????????????????
.......
End SubPrivate Sub myCls_SendMessage()
msgbox "Message Arive"
End Sub程序在执行时会出现错误,错误代码是80004005,看MSDN说是Remote Automation不支持WithEvents!但听说有人可以做到这一点,不知道是不是借用了其他软件。当然用DCOM是
能够做到的。但如果是在win95/win98做服务器和工作站时又怎么样配置网络呢?
所以无论使用DCOM还是RPC都没有问题,只需要设一下
相关权限就可以了,用win95/98作服务器我想需要安装
DCOM95/98(Visual Studio 光盘里面有)。
WUCCC,您能不能详细讲解一下95/98下网络的设置方法(NT4。0和windows2000我会的)
看了一下,解释如下:
Set myCls = New Class1 不对
应当为
Set myCls = CreateObject("Class1","ServerName")
其中"ServerName"是服务器的计算机名.
在95/98下网络不需特别设置,反而在NT下权限设置很麻烦.
[email protected]