WScript.CreateObject crashes Windows Scripting Host when event handler prefix is specified for WinHTTPRequest

前端 未结 1 1975
囚心锁ツ
囚心锁ツ 2021-01-15 17:55

According to the MSDN documentation WinHTTPRequest has four event handlers which should be accessible by specifying an event handler prefix. Unfortunately, doing so causes

相关标签:
1条回答
  • 2021-01-15 18:16

    It's not part of the specification in any way. Wishful programming rarely works.

    Creates and returns a reference to an Automation object.

     CreateObject(servername.typename [, location])
    

    Arguments

    servername

    Required. The name of the application providing the object.

    typename

    Required. The type or class of the object to create.

    location

    Optional. The name of the network server where the object is to be created.

    If you want to make up your own wishful specifications, see if you can add your own parameters to this one.

    From Help for GetRef

    Returns a reference to a procedure that can be bound to an event.

    Set object.eventname = GetRef(procname)
    

    Arguments

    object

    Required. Name of the object with which event is associated.

    event

    Required. Name of the event to which the function is to be bound.

    procname

    Required. String containing the name of the Sub or Function procedure being associated with the event.

    0 讨论(0)
提交回复
热议问题