[Quickfix-developers] .NET & COM threading models
Brought to you by:
orenmnero
From: John D. <joh...@ch...> - 2004-04-13 21:36:34
|
Hi, I'm trying to use QuickFix 1.7.0 within a server hosted on .NET = Remoting. I'm running into some incompatibilities between the COM threading model Remoting sets up and QuickFix, which uses an STA model. Specifically, = within the function MSXML_DOMDocument::MSXML_DOMDocument(), the line: if(FAILED(CoInitialize(NULL))) throw ConfigError("Could not initialize COM"); throws an exception. The reason is that CoInitialize() "initializes the = COM library on the current thread and identifies the concurrency model as single-thread apartment (STA)," to quote the documentation. Before this = code is run, the .NET runtime has already set the current thread to run = within an MTA model. I believe I have a fix in place by replacing CoInitialize with CoInitializeEx and setting dwCoInit to COINIT_MULTITHREADED, but won't = be sure until I have an opportunity to thoroughly test tomorrow. In the meantime I was hoping for a little guidance. Has anyone had any experience mixing COM threading models with QuickFix? = Is there a different XML library I can use besides MSXML? What does the = *nix implementation use? Thanks in advance. John -----------------------------------------------------------=20 This email message is intended only for the addressee(s)=20 and contains information that may be confidential and/or=20 copyright. If you are not the intended recipient please=20 notify the sender by reply email and immediately delete=20 this email. Use, disclosure or reproduction of this email=20 by anyone other than the intended recipient(s) is strictly=20 prohibited. No representation is made that this email or=20 any attachments are free of viruses. Virus scanning is=20 recommended and is the responsibility of the recipient. Thank you. -----------------------------------------------------------=20 For more information on CTC, LLC please visit our website at:=20 http://www.chicagotrading.com. |