Re: [Quickfix-developers] Adding Custom Message to Fix42.xml and handling in application
Brought to you by:
orenmnero
From: Yasir Z. <yas...@ya...> - 2009-03-03 05:07:41
|
Hi Niks, I have been out of touch from Quick FIX for a quite while but I know one thing making changes to the Fix42.xml file doesn't means that you have that message class in you code even after recompiling. For that you have to change the code of the Quick FIX Solution file. I think you need to add the custom class in 'fix42' directory and also make some changes to "Messages.cpp" and "Messages.h" in project file that need to be changed. After adding all this and re-compiling the new class you will be able to see the Custom class in the dll. For a custom message you need not to made such changes these changes will be helpful if you are sending your configured FIX library to a third party. The other thing you asked was changes made to FIX42.xml file, this file is the data dictionary that only tells the quick fix engine that these are the only messages to support and what are its format. If you are using data dictionary you will get an invalid message error if the engine do not receive any message according to this specification. So the message section you just added will be helpful for the engine to understand the incoming Custom message from other source and you have already done that. (However you can get rid of this verification by Quick FIX engine using the check in the configuration file "usedatadictionary=N". This means your fix engine will not show any error on any sort of custom message received.) Now what you have to do for a Custom Message. 1- Add the XML in your data Dictionary FIX42.xml like you just did OR use the check in configuration file "usedatadictionary=N". I prefer first one to receive the custom message. 2- Add some code to your application class to send the custom message. // Initialize new custom message QuickFix42.Message message42 = new QuickFix42.Message( new MsgType(yourmsgtype) ) // Set all fields you required message42.SetField("key","value"); // Send the message to the target Session.sendToTarget(message42, yoursessionid); Regards, Yasir Zaheer. |