Re: [Quickfix-developers] Custom FIX Message Types
Brought to you by:
orenmnero
From: <or...@qu...> - 2008-10-09 22:48:24
|
True, however this is why we have the MessageFactory. If you notice QuickFIX comes with a DefaultMessageFactory. QuickFIX will pass the message type of the message it is parsing and the factory should return an instance of the correct derived type. This ensures the casting will not fail when the message reaches the message cracker. You can override the DefaultMessageCracker to instantiate your custom objects, then make sure to pass along to the base class any message that are not yours. --oren > -------- Original Message -------- > Subject: Re: [Quickfix-developers] Custom FIX Message Types > From: "Andrei Goldchleger" <an...@gm...> > Date: Wed, October 08, 2008 7:39 pm > To: > Cc: qui...@li... > QuickFIX Documentation: http://www.quickfixengine.org/quickfix/doc/html/index.html > QuickFIX Support: http://www.quickfixengine.org/services.html > On Wed, Oct 8, 2008 at 9:15 PM, Malinka Rellikwodahs > <ael...@gm...> wrote: > > QuickFIX Documentation: http://www.quickfixengine.org/quickfix/doc/html/index.html > > QuickFIX Support: http://www.quickfixengine.org/services.html > > > > > > Data Dictionary is updated with values and correct I receive the message properly but when I try to cast them to the new type it fails > As far as I know, what you are trying to do is not possible in C#. You > cannot cast a reference to a base type into an derived type. In C++, > this can be done since you can cast everything into anything (you > might end up with a mess, but it is possible). As specialized message > classes in QuickFIX (e.g. QuickFIX44::NewOrderSingle) are just > wrappers around the same methods in the QuickFIX::Message class, this > works perfectly in C++, but does not in C#. > However, there is still hope: if you rather have your custom messages > as specialized message classes in QuickFIX, the following post > explains how you can generate a customized QuickFIX version, which > will allow exactly what you want to achieve: > http://sourceforge.net/mailarchive/message.php?msg_id=320836.47930.qm%40web31010.mail.mud.yahoo.com > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Quickfix-developers mailing list > Qui...@li... > https://lists.sourceforge.net/lists/listinfo/quickfix-developers |