Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

-2147221231 Automation error (XML + VB)

Status
Not open for further replies.

DeltaTech

Programmer
Apr 16, 2003
92
MY
Hi Everyone
Posted this on the XML board but had no luck.
I am re-posting this on the VB board together with Tsuji's suggestions, hoping someone has encountered a similar problem and has found a solution for it.
Anyone please?
Thanks in advance.
[bigcheeks]
------------------------------------------------------------------------------------------------------------------
Hi
I am using XML with my VB app, and everything works fine on the development PC which runs on XP Pro.
When I install it on a test PC running WinME though it gives me the above error.
The error occurs on this line of code:

Code:
Dim objXMLHTTP As xmlHTTP
Dim xmlHTTP As MSXML2.ServerXMLHTTP30
Dim xmlDoc As MSXML2.DOMDocument30

    Set xmlDoc = New MSXML2.DOMDocument30

    'Error occurs here
    Set xmlHTTP = New MSXML2.ServerXMLHTTP30
Can anyone help please?
Thanks in advance.

------------------------------------------------------------------------------------------------------------------
tsuji (TechnicalUser) 2 Dec 05 11:00
Try rather this?
>Dim xmlHTTP As MSXML2.ServerXMLHTTP30
Dim xmlHTTP As Microsoft.XMLHTTP
>Set xmlHTTP = New MSXML2.ServerXMLHTTP30
Set xmlHTTP = New Microsoft.XMLHTTP

You may find win9x series not supporting msxml2.serverxmlhttp class.

------------------------------------------------------------------------------------------------------------------
DeltaTech (Programmer) 2 Dec 05 19:17
Hi tsuji
Thanks for this, but does this mean that I have to reference a new/different DLL?

------------------------------------------------------------------------------------------------------------------
tsuji (TechnicalUser) 2 Dec 05 20:44
Can make the same reference to
Microsoft XML, v3.0
as you seem to making version dependent domdocument. In that case, type it like this.
Dim xmlHTTP As MSXML2.xmlHTTP
Set xmlHTTP = New MSXML2.xmlHTTP
The dll in question is targetted to msxml3.dll.

------------------------------------------------------------------------------------------------------------------

[red]The above did not help as I am already referencing msxml3.dll, and therefore the automation error still occurs on the test PC.[/red]

Tsuji -> Thanks for trying, but it's just not working.
 
I have those lines here. I debug.print typename(xmlHTTP). It shows me IXMLHTTPRequest. Your system must be special, or mine!
 
Sorry, Tsuji, I do not understand what you mean.
As I mentioned in my first post, the code works fine on the development PC (WinXP Pro), but fails on a test PC (WinME).
Obviously, something is lacking on the test PC, perhaps a DLL or control that is required for this to work, or because it is a version of Windows earlier than XP.
Is yours an XP or earlier version? Perhaps we can rule that out if we knew.
 
I have a winME. I do read your posting and advise accordingly.
 
Hi Tsuji
Nothing personal my friend. I am sorry if you took offence to my reposting it in this forum.
The truth is, it does not seem to be working on the test PC, and chances are it might not work on my client's PC.
Question: Have you tried installing your app on a clean PC and tested to see if it works without this automation error?
Anyways, as I said, no offence, and I do sincerely appreciate your attempts to help.
Regards
[bigcheeks]
 
By the way, the error is described on Microsoft's webpage INFO: Translating Automation Errors for VB/VBA (Long) as:

Automation Automation
Error in Error in
Decimal Hex Error Description

-2147221231 (80040111) ClassFactory cannot supply requested class.

I have absolutely no idea what this means.

Thinking that perhaps I may have to manually register the DLL, I tried it (RegSvr32), but got this error:

LoadLibrary("C:\WINDOWS\SYSTEM32\MSXML3.DLL") failed
GetLastError returns 0x0000045a.


Which confuses me even more.

Can someone help a tortured soul who is running out of time please?

Thanks
[bigcheeks]
 
SYSTEM32 ??, shouldn't that be plain old SYSTEM ?
 
<I have absolutely no idea what this means.
I didn't either, so I copied the string into google and hit my trusty "Google Search" button. Right at the top was a brief perusal of which leads to the idea that the object you're trying to instantiate isn't supported in Windows ME, although only the Win 9x platforms are specifically mentioned.

I note with interest that this is what tsuji originally suggested. Did you in fact try tsuji's code as written?

Bob
 
Hi BobRodes

Yes, I did try Tsuji's suggestion, but there was no joy.
Tsuji was right in that I was being version specific, but even after I changed it, the same error came up.

"the object you're trying to instantiate isn't supported in Windows ME"

Tsuji is using WinME and it works, so I am inclined to think that it is supported, although my initial instinct was that it did not.

Thanks

[bigcheeks]
 
DeltaTech, a couple of thing is clear.

[1] msxml2.serverxmlhttp is supported by winnt series. That is my diagnostic of your original problem and advised accordingly to switch to msxml2.xmlhttp class for win9x series (meaning including winme).

[2] Then in the original problem, you said msxml2.domdocument class referenced flawlessly. That new line is written before your calling to serverxmlhttp. If that line to domdocument does not provoke error, then your msxml v3.0 should be properly installed.

That is why I am really frustrated for the internal contradition of your messages. Can you tell us whether the line msxml2.domdocument version specific or not run no problem? If it errors out as well, I would advise you to re-install the msxml package. If not, you have a problem.

In your vb ide, you make a reference to microsoft xml v3.0 or v4.0 (it's up to you as long as it is installed and the code lines reflect it if you use version-specific progid). But I suppose you know and have done that. If not, it is again a contradition within your messages.

But, a re-installation is still a possible short-cut. You're not going to regsvr32 msxml3.dll as such, no. That is normal what you see the message.

In your ide, when you reference to the component, you will see the path normally is c:\window\system\msxml3.dll (not system32 as pointed out, not normally).

msxml2 is a heavyweight component which includes domdocument and xmlhttp. That is why is said you must have referenced to the component in the vb ide. But, apparently you still manage to have problem.

You can also search your registry for keyword like msxml2.xmlhttp, and you should find significant entry in the hkcr branch. If not, you have definitely to install again msxml v3 or v4 package.
 
<Tsuji is using WinME and it works, so I am inclined to think that it is supported.

The above posts don't define "it" clearly enough to rule one way or the other on that. Tsuji is clearly NOT using the code that you posted as not working, and it's unclear exactly which of his code lines that you continue to error out on.

Perhaps you can post the relevant code, that incorporates tsuji's suggestions, as well as noting the line where your code errors out. Furthermore, also post the relevant references that you are using, and the order you reference them in. Given that information, we can rule out any discrepancies that might exist between your code and tusji's. It can't be determined from the above posts that you have duplicated tsuji's working setup on your machine. Digging deeper before we have that down for sure is putting the cart before the horse.

HTH

Bob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top