"Error creating MSXML Document class" in service application

Hi,

I have a server and client application which works fine. But now I want to convert the serverapplication to a windows service.

When running my client with the windows service, I get an exception when opening a TDAMemDataTable:

Project xxxxx raised exception class EROUnregisteredServerException withe message ‘Error creating MSXML Document class’.

EOleSysError: CoInitialize has not been called, ClassId: {88D…

I’m using version 6.0.39.777 of Remobjects.

Any help would be greatly appreciated, because this problem is driving me crazy…

Thanks.

Kristof

Hi,

add in your project source in the beginning of uses section uROCOMinit unit.

Thanks!

Sorry to resurrect this thread but I’ve got a very odd problem.

My server does the above with the uROComInit file and runs without problems. However I’ve now created a Delphi DLL which is statically linked into this server application so it loads at runtime.

The problem I’m getting is that I get the above “CoInitialize has not been called” exception within my server, even though no calls have been made to the DLL at all. Simply removing the DLL cures the problem.

The DLL does call CoInitialize(NIL) itself but I tried removing that to no avail. I then tried adding the uROComInit file as the first file in the DLL’s uses clause but, when I do that, the application seizes up when I run it and I have to kill it via task manager.

Any ideas?

try to use

uROInitializedThread.ROInitializeThreads := True;

in your .dll . it also calls

CoInitialize(nil);

Had to shelve this but have just returned to it and still having the same issue - nothing I do, including the last suggestion, fixes the problem.

can you create a simple testcase that reproduces this case, pls?
you can attach it here or send directly to support@

Will do when I get a chance.

I seem to have fixed it for now by changing from static to delayed binding. Obviously doing it this way, by the time the DLL loads, the main app has properly initialised whereas, with static binding, it’s loading the DLL before the main app has initialised something or other which is what seems to be causing the problem.