Thread: [Quickfix-developers] Custom FIX Message Types
Brought to you by:
orenmnero
From: Malinka R. <ael...@gm...> - 2008-10-08 23:50:02
|
I know this has been discussed before however looking through the archive i was unable to determine how to successfully add a new message type to the system, so that it will work with MessageCracker. In C#, I created a new class inheriting QuickFix44 with the tags I will be needing in this message, and then in my Application/Message Cracker object I added a public new void onMessage(QuickFix.Message, QuickFix.SessionID ses), which I created an if statement looking for the MsgType value the new Message will be using, which all works correctly, however when I try casting to the new message type, the same as is done in the QuickFix44 MessageCracker, It throws an InvalidCastException saying it can't convert from QuickFix44.Message to my new Message type. After looking through the Message code I'm not seeing why this would be. Any help or suggestions would be appreciated. |
From: Shane T. <str...@co...> - 2008-10-08 23:59:52
|
You should check the DataDictionary XML file, it defines the message structures/fields. You should be able to add fields/types there. -- Shane Trotter Connamara Systems, LLC On Wed, Oct 8, 2008 at 6:49 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 > > > I know this has been discussed before however looking through the archive i > was unable to determine how to successfully add a new message type to the > system, so that it will work with MessageCracker. > > In C#, I created a new class inheriting QuickFix44 with the tags I will be > needing in this message, and then in my Application/Message Cracker object I > added a public new void onMessage(QuickFix.Message, QuickFix.SessionID ses), > which I created an if statement looking for the MsgType value the new > Message will be using, which all works correctly, however when I try casting > to the new message type, the same as is done in the QuickFix44 > MessageCracker, It throws an InvalidCastException saying it can't convert > from QuickFix44.Message to my new Message type. After looking through the > Message code I'm not seeing why this would be. Any help or suggestions > would be appreciated. > > ------------------------------------------------------------------------- > 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 > |
From: Malinka R. <ael...@gm...> - 2008-10-09 00:15:21
|
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 On Wed, Oct 8, 2008 at 7:59 PM, Shane Trotter <str...@co...>wrote: > You should check the DataDictionary XML file, it defines the message > structures/fields. You should be able to add fields/types there. > > -- > Shane Trotter > Connamara Systems, LLC > > On Wed, Oct 8, 2008 at 6:49 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 >> >> >> I know this has been discussed before however looking through the archive >> i was unable to determine how to successfully add a new message type to the >> system, so that it will work with MessageCracker. >> >> In C#, I created a new class inheriting QuickFix44 with the tags I will be >> needing in this message, and then in my Application/Message Cracker object I >> added a public new void onMessage(QuickFix.Message, QuickFix.SessionID ses), >> which I created an if statement looking for the MsgType value the new >> Message will be using, which all works correctly, however when I try casting >> to the new message type, the same as is done in the QuickFix44 >> MessageCracker, It throws an InvalidCastException saying it can't convert >> from QuickFix44.Message to my new Message type. After looking through the >> Message code I'm not seeing why this would be. Any help or suggestions >> would be appreciated. >> >> ------------------------------------------------------------------------- >> 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 >> > > |
From: Andrei G. <an...@gm...> - 2008-10-09 00:39:58
|
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 |