RE: [Quickfix-developers] QuickFix.ConfigError
Brought to you by:
orenmnero
From: Ramprakash U. <ram...@ca...> - 2004-05-28 10:14:07
|
Hi Miler, You're right. I tried to use MTA in my code and after setting STA in my class it works fine now. I have added [ STAThread ] in C# code on my class. It works fine now. Basically I'm VB Guy finding lot of difficulties to code in C#. There = seems to be a problem in using VB.NET code in QuickFix.NET. Any idea why it = does n't work? Please refer to my earlier post regarding this http://sourceforge.net/mailarchive/forum.php?thread_id=3D4789984&forum_id= =3D103 Thanks a lot. Ram -----Original Message----- From: Oren Miller [mailto:or...@qu...]=20 Sent: gioved=EC 27 maggio 2004 18:04 To: Ramprakash Umapathy Cc: qui...@li... Subject: Re: [Quickfix-developers] QuickFix.ConfigError What concurrency model are you using? Try changing the following lines = in MSXML_DOMDocument.cpp from this: if(FAILED(CoInitialize(NULL))) throw ConfigError("Could not initialize COM"); to this: HRESULT hresult =3D CoInitializeEx( NULL, COINIT_APARTMENTTHREADED ); = if( hresult !=3D RPC_E_CHANGED_MODE && FAILED(hresult) ) throw ConfigError("Could not initialize COM"); My guess is that you are using MTA, and CoInitialize sets to STA, which = is illegal. This change will attempt to use STA if COM hasn't been =20 loaded, but will use whatever threading model you've set if it has. =20 Let me know if this fixes your problem and I'll check it in. On May 27, 2004, at 10:23 AM, Ramprakash Umapathy wrote: > Hi, > > I have just started learning QuickFix in .NET > > I trying to use SocketAcceptor I get an error whenever I initialize > that. > > The Error is, > > An unhandled exception of type 'QuickFix.ConfigError' occurred in=20 > WindowsApplication1.exe > > Additional information: Configuration failed: Could not initialize COM > > Unhandled Exception: QuickFix.ConfigError: Configuration failed: Could > not > initialize COM > at ReceiveFixEngineCS.Test.Main(String[] args) in c:\documents and > settings\umapar1a\my documents\visual studio > projects\cabutilities\testingprojects\windowsapplication1\class1.cs:=20 > line > 37The program '[468] WindowsApplication1.exe' has exited with code 0 =20 > (0x0). > > The code is here, > > =09 > String fileName =3D "server.cfg"; > SessionSettings settings =3D new SessionSettings(fileName); > Application application =3D new Application(); > FileStoreFactory storefactory =3D new FileStoreFactory(settings); > ScreenLogFactory logFactory =3D new ScreenLogFactory( true, true, = true > ); > =09 > MessageFactory messageFactory =3D new DefaultMessageFactory(); > > SocketAcceptor acceptor > =3D new SocketAcceptor( application, storefactory, settings,=20 > logFactory, messageFactory ); > > > > The configuration file is this, > > [DEFAULT] > ConnectionType=3Dacceptor > SocketAcceptPort=3D5001 > FileStorePath=3Dstore > StartTime=3D00:00:00 > EndTime=3D00:00:00 > > [SESSION] > BeginString=3DFIX.4.2 > SenderCompID=3Ds09183 > TargetCompID=3Dumapar1a > DataDictionary=3DFIX42.xml > > Any help is appreciated, > > Ramprakash > > > > > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: Oracle 10g > Get certified on the hottest thing ever to hit the market... Oracle > 10g. > Take an Oracle 10g class now, and we'll give you the exam FREE. > http://ads.osdn.com/?ad_id=3D3149&alloc_id=3D8166&op=3Dclick > _______________________________________________ > Quickfix-developers mailing list > Qui...@li... > https://lists.sourceforge.net/lists/listinfo/quickfix-developers > |