RE: [Quickfix-developers] .NET & COM threading models
Brought to you by:
orenmnero
From: John D. <joh...@ch...> - 2004-04-14 22:50:20
|
Oren, Thanks for the reply. I substituted in libxml2 in place of MSXML, but ran into a problem when I tried to parse the FIX 4.2 message definition file. Specifically, in this code: bool LIBXML_DOMDocument::load( const std::string& url ) { QF_STACK_PUSH(LIBXML_DOMAttributes::lead) try { m_pDoc = xmlParseFile(url.c_str()); return m_pDoc != NULL; } catch( ... ) { return false; } QF_STACK_POP } xmlParseFile() throws. It seems to be crashing somewhere, but I downloaded the libxml binaries, not the source code, so I am not seeing exactly where it's having a problem. I tried reducing the XML file in case there was a problem tag somewhere inside of it (even though MSXML parsed it without issue), but this did not help. This may be a question that is more germane to libxml than to QuickFix, but I was hoping someone had come across this in the past. Thanks, John -----Original Message----- From: QuickFIX [mailto:or...@qu...] Sent: Tuesday, April 13, 2004 5:52 PM To: John Debay Cc: qui...@li... Subject: [Quickfix-developers] .NET & COM threading models John, If you are unable to resolve this with MSXML, QuickFIX also supports libxml2, which is open source and also has a windows binary distribution. See the installation instructions for how to tell QuickFIX to build against libxml in place of MSXML3: http://quickfix.sourceforge.net/quickfix/doc/html/ install.html#Windows%20(C++) --oren On Apr 13, 2004, at 4:36 PM, John Debay wrote: > 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 > > ----------------------------------------------------------- > This email message is intended only for the addressee(s) > and contains information that may be confidential and/or > copyright. If you are not the intended recipient please > notify the sender by reply email and immediately delete > this email. Use, disclosure or reproduction of this email > by anyone other than the intended recipient(s) is strictly > prohibited. No representation is made that this email or > any attachments are free of viruses. Virus scanning is > recommended and is the responsibility of the recipient. > > Thank you. > ----------------------------------------------------------- > > For more information on CTC, LLC please visit > our website at: > > http://www.chicagotrading.com. > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click > _______________________________________________ > Quickfix-developers mailing list > Qui...@li... > https://lists.sourceforge.net/lists/listinfo/quickfix-developers > |