我的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那里出错,但不知道怎么处理

解决方案 »

  1.   

    activex exe也是可以调试的嘛,你看看是哪行出错?
      

  2.   

    仔细研究下这个代码,你搜索一下:' ==============================================================
    ' 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。
      

  3.   

    activex exe可以单独调试,看看哪里有问题先
      

  4.   

    activex exe 无法传数据库对象。
      

  5.   

    XMLHTTP可以支持异步工作的,在后面做个等待就ok了。
      

  6.   

    可以用类绑定OnReadyStateChange事件
    '注意将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