我的activeX引用了xmlhttp对象
Private mForm As Form1
Event GatherStart(ByRef html As String)
Public website As String
Private WithEvents tm As TimerPrivate Sub Class_Initialize()
Set mForm = New Form1
Load mForm
Set tm = mForm.Timer1
End SubPrivate Sub Class_Terminate()
Set mForm = Nothing
End SubPrivate Sub tm_Timer()
Dim httpreg As New MSXML2.XMLHTTP
httpreg.open "get", website, False
httpreg.send
DoEvents
Dim aa As String
aa = httpreg.responseText
'aa = "sdfsdfsdfsdf"
RaiseEvent GatherStart(aa)
tm.Enabled = False
End Sub当在外部掉用时,出现"无效的过程或调用参数",请高手帮我看看,是什么原因,大至原因我知道是xmlhttp那里出错,但不知道怎么处理
Private mForm As Form1
Event GatherStart(ByRef html As String)
Public website As String
Private WithEvents tm As TimerPrivate Sub Class_Initialize()
Set mForm = New Form1
Load mForm
Set tm = mForm.Timer1
End SubPrivate Sub Class_Terminate()
Set mForm = Nothing
End SubPrivate Sub tm_Timer()
Dim httpreg As New MSXML2.XMLHTTP
httpreg.open "get", website, False
httpreg.send
DoEvents
Dim aa As String
aa = httpreg.responseText
'aa = "sdfsdfsdfsdf"
RaiseEvent GatherStart(aa)
tm.Enabled = False
End Sub当在外部掉用时,出现"无效的过程或调用参数",请高手帮我看看,是什么原因,大至原因我知道是xmlhttp那里出错,但不知道怎么处理
' FileName: mStart.bas
' Author: SP McMahon
' Date: 2 February 2000
'
' This BAs module gives you the code you need to implement the
' Java out-of-process style threading model in VB. Just
' add it to an ActiveX EXE, reference Runnable.TLB and then
' do this in your ActiveX EXE:
'
' Implements Runnable
'
'
'
' based on the Codeflow sample ?1997 Microsoft
' from Microsoft. Microsoft has no warranty,
' obligations or liability for any code used here.
'
' ==============================================================
通过这样方式调试:
先将 ActiveX EXE 搞成ActiveX DLL,没有问题再搞成 ActiveX EXE。
'注意将Class的OnReadyStateChange设置成default
'点工具——过程属性——高级——过程标识符——缺省
'class1
Option ExplicitPublic Event OnReadyStateChange()
Public Sub OnReadyStateChange()
msgbox "OnReadyStateChange"
End Sub'form1
dim down as class1
Set XMLHTTP = CreateObject("Msxml2.XMLHTTP.5.0")
XMLHTTP.Open "Get", URL, True
XMLHTTP.OnReadyStateChange = Down
XMLHTTP.send