0

I downloaded QuickFix.dll from quickfixengine.org

When I declare an object which belongs to namespace QuickFix::Fields, I cannot get its corresponding base value (I mean char value for OrdType, string value for OrderID etc). As there are no properties associated with them.

Is there any other way to achieve the same?

The code is:

......
QuickField::Fields::OrdType ordType;
message.Get(OrdType);//message is a NewOrderSingle 
                     //type object defined prevviously in the code
                     //Now i wish to get the value contained in "ordType" but it has no
                     //properties to access its data member(s)
L_J
  • 2,351
  • 10
  • 23
  • 28
Rampal Chaudhary
  • 707
  • 1
  • 8
  • 18

1 Answers1

1

This is what you want to see:

QuickField::Fields::OrdType ordType;
message.get(ordType);
char char_value = ordType.getValue();

Advice: check out the class documentation. The field base class is FIX::FieldBase, which derives into FIX::StringField, FIX::BoolField, FIX::IntField, etc. All of these have a getValue() function which returns the raw field value converted into the proper data type.

Another way to do this (much less legitimate) is to use Message::getField(int) which returns the value of a field as a string. So you could use std::string str_value = message.get(40);, but you'd have a string instead of a char (or int or bool or whatever).

Grant Birchmeier
  • 17,809
  • 11
  • 63
  • 98
  • checked through C# visual studio's object browser, it didn't show any properties or functions, checked VC++ visual studio's object browser, it didn't show any properties or functions, VC++ has not got intelliscence, so i declared an object in C# and checked for functions through intelliscence it showed getValue() and other functions – Rampal Chaudhary Jan 23 '13 at 04:02
  • Not actually, because i figured it out before i saw your answer(no offence meant) but it definitely deserves an upvote and tick as it is the right answer. – Rampal Chaudhary Jan 24 '13 at 04:06