0

I'm battling with the QuickFix engine in .Net (using the C++ DLL wrapper) to craft a TradeCaptureReportRequest message:

var req = new QuickFix44.TradeCaptureReportRequest();
req.set(new QuickFix.SubscriptionRequestType(QuickFix.SubscriptionRequestType.SNAPSHOT_PLUS_UPDATES)); // 263
req.set(new QuickFix.TradeRequestID("testing" + DateTime.Now.Second.ToString())); // 568
var nodates = new QuickFix44.TradeCaptureReportRequest.NoDates();
nodates.set(new QuickFix.TradeDate("20130201"));
req.set(nodates); // 580

Everything seems to look good until I call req.set(nodates), which causes a compiler error saying that "NoDates cannot be converted to a NoDates".

This boggles my mind since when I navigate to the metadata of the TradeCaptureRequest within the QuickFix dll, i am shown this.

public void set(NoDates value);
 // as a member of QuickFix44.TradeCaptureReportRequest

if I go to the definition of NoDates it sends me to the QuickFix44.TradeCaptureReportRequest.NoDates Class defined within the QuickFix44.TradeCaptureReportRequest class.

however there is a NoDates Class defined within the QuickFix namesapace which compiles just fine when I do the following.

req.set(new QuickFix.NoDates(1));

I'm using Quickfix v4.0.30128 and the .Net wrapper for the C++ DLL.

user7116
  • 63,008
  • 17
  • 141
  • 172
priehl
  • 644
  • 2
  • 9
  • 21

1 Answers1

0

If you look at the C# code for TradeCaptureReportRequest.set you'll find that it would like a QuickFix.NoDates type for the NoDates value:

// line: 1993
public void set(QuickFix.NoDates value)
{ setField(value); }

So change your C# to the following:

var nodates = new QuickFix.NoDates();
nodates.set(new QuickFix.TradeDate("20130201"));
req.set(nodates);

It appears you're using the QuickFix .Net wrapper over the C++, which is an abomination of .Net programming guidelines. I highly recommend you switch to QuickFIX/N, which is less horrible (but still awful looking).

user7116
  • 63,008
  • 17
  • 141
  • 172
  • apparently i can do something like this, go figure... QuickFix44.TradeCaptureReportRequest.NoDates nodates = new QuickFix44.TradeCaptureReportRequest.NoDates(); nodates.set(new QuickFix.TradeDate("20130211")); req.addGroup(nodates); // 75 – priehl Feb 12 '13 at 21:43