1

Topic: GetTypeInfo takes off on an exception

Day kind! Prompt, in what there can be an ambush. There is an object "Msxml2.ServerXMLHTTP.6.0", and at it property "ResponseStream". I need to receive the information on type. If to cause GetTypeInfo for most Msxml2.ServerXMLHTTP.6.0, all normally fulfills. If to cause GetTypeInfo for ResponseStream, the type exception "The instruction at 0x762A9F40 referenced memory at 0x00000000, the memory could not be read" takes off. Where to dig?

2

Re: GetTypeInfo takes off on an exception

Hello, Vaynamond, you wrote: V> Prompt, in what there can be an ambush. V> there is an object "Msxml2.ServerXMLHTTP.6.0", and at it property "ResponseStream". V> I need to receive the information on type. If to cause GetTypeInfo for most Msxml2.ServerXMLHTTP.6.0, all normally fulfills. V> if to cause GetTypeInfo for ResponseStream, the type exception "The instruction at 0x762A9F40 referenced memory at 0x00000000, the memory could not be read" takes off. V> Where to dig? Probably, the code needs to be put. If this method returns VARIANT not-dispatch the interface which simply does not have such method there can contain.

3

Re: GetTypeInfo takes off on an exception

Hello, Vi2, you wrote: Vi2> Hello, Vaynamond, you wrote: V>> Prompt, in what there can be an ambush. V>> there is an object "Msxml2.ServerXMLHTTP.6.0", and at it property "ResponseStream". V>> I need to receive the information on type. If to cause GetTypeInfo for most Msxml2.ServerXMLHTTP.6.0, all normally fulfills. V>> if to cause GetTypeInfo for ResponseStream, the type exception "The instruction at 0x762A9F40 referenced memory at 0x00000000, the memory could not be read" takes off. V>> Where to dig? Vi2> probably, the code needs to be put. If this method returns VARIANT not-dispatch the interface which simply does not have such method there can contain. Here that the new view - really means, GetTypeInfo is caused on IDispatch which, seemingly, at ServerXMLHTTP is not present - is only IUnknow and IStream. Then a new question: and how it is correct  such situation? It is clear that before call GetTypeInfo it is necessary to pull QueryInterface for obtaining IDispatch. If IDispatch received, we work, and if is not present? VBA, for example, for ResponseStream in the column "Type" produces "Variant / <Unsupported object type>". To be restricted to the similar approach?

4

Re: GetTypeInfo takes off on an exception

Hello, Vaynamond, you wrote: V> Here that the new view - really means, GetTypeInfo is caused on IDispatch which, seemingly, at ServerXMLHTTP is not present - is only V> IUnknow and IStream. V> Then a new question: and how it is correct  such situation? V> it is clear that before call GetTypeInfo it is necessary to pull QueryInterface for obtaining IDispatch. If IDispatch received, we work, V> and if is not present? VBA, for example, for ResponseStream in the column "Type" produces "Variant / <Unsupported object type>". V> To be restricted to the similar approach? The exact knowledge of the interface is how much critical. For example, VarType (OBJ_VARIANT) gives 9 (' VT_DISPATCH or VB' vbObject) for those objects for which is IDispatch, and 13 (' VT_UNKNOWN or VB' vbDataObject) for at whom it precisely is not present. It is possible to request specific names of interfaces, for example, Dim os As IStream ' IUnknown or ISequentialStream or IStream Set os = OBJ_VARIANT If Not (os Is Nothing) Then type = "IStream". PS There is function TypeName (OBJ_VARIANT), it can return something useful.

5

Re: GetTypeInfo takes off on an exception

Hello, Vi2, you wrote: Vi2> Hello, Vaynamond, you wrote: V>> Here that the new view - really means, GetTypeInfo is caused on IDispatch which, seemingly, at ServerXMLHTTP is not present - is only V>> IUnknow and IStream. V>> Then a new question: and how it is correct  such situation? V>> it is clear that before call GetTypeInfo it is necessary to pull QueryInterface for obtaining IDispatch. If IDispatch received, we work, V>> and if is not present? VBA, for example, for ResponseStream in the column "Type" produces "Variant / <Unsupported object type>". V>> To be restricted to the similar approach? Vi2> the exact knowledge of the interface is how much critical. For example, VarType (OBJ_VARIANT) gives 9 (' VT_DISPATCH or VB' vbObject) for those objects for which is IDispatch, and 13 (' VT_UNKNOWN or VB' vbDataObject) for at whom it precisely is not present. Vi2> It is possible to request specific names of interfaces, for example, Vi2> Vi2> Dim os As IStream ' IUnknown or ISequentialStream or IStream Vi2> Set os = OBJ_VARIANT Vi2> If Not (os Is Nothing) Then type = "IStream". Vi2> Vi2> PS Vi2> There is function TypeName (OBJ_VARIANT), it can return something useful. Clearly. Thanks!