{{Quickfixn}} Casting a generic group to a specifc group not working

Logan Moore logan.moore at velocitytrade.com
Mon Apr 2 19:26:20 PDT 2012


Hey all,

I've written a basic fix initiator to get ticks from Currenex into a database where we can calculate spread averages. I'm running into problems handling the MarketDataIncrementalRefresh though.

I need to get the NoMDEntriesGroup(s) out of the message in order to get the market data out of them, but when I try and store the group in the appropriate class, my compiler complains that it can't implicitly cast the returned group into that class type. Here's the basic code that causes the problem.

public void OnMessage(QuickFix.FIX42.MarketDataIncrementalRefresh message, SessionID sessionID)
{
    MDReqID mdReqID = message.MDReqID;
    var noMDEntriesGroup = new QuickFix.FIX42.MarketDataIncrementalRefresh.NoMDEntriesGroup();
    for (int grpIndex = 1; grpIndex <= message.GetInt(Tags.NoMDEntries); grpIndex += 1)
    {
        noMDEntriesGroup = message.GetGroup(grpIndex, Tags.NoMDEntries);
        // code omitted here
    }
}

And here's the error message that VS2010 throws.
Error 1 Cannot implicitly convert type 'QuickFix.Group' to 'QuickFix.FIX42.MarketDataIncrementalRefresh.NoMDEntriesGroup'. An explicit conversion exists (are you missing a cast?)

Is there a trick to get the returned Group to cast into a NoMDEntriesGroup?


Believing this to be a bug, I opened up an issue at https://github.com/connamara/quickfixn/issues/56

Thanks,
Logan



------------------------------------------------------------------------------------------------------------
This email and its attachments may be confidential and are intended solely for the use of the individual to whom it is addressed. 
Any views or opinions expressed are solely those of the author and do not necessarily represent those of Velocity Trade (VT) or any of its affiliates.  In no way are the contents of this email be viewed as a solicitation of any kind.  If you are not the intended recipient of this email and its attachments, you must take no action based upon them, nor must you copy or show them to anyone. 
Please contact the sender if you believe you have received this email in error. Velocity Trade Foreign Exchange Services Ltd is an Authorised Representative of Velocity Trade International Limited - regulated by the Financial Services Authority (FSA No. 497263). 
The VT Group is also regulated by the Australian Securities and Investment Commission; the Financial Markets Authority in New Zealand; the FSB, South Africa and is registered with Fintrac Canada. VT is a member of the Johannesburg Stock Exchange. VT has offices in Toronto, Montreal, New York, London, Cape Town, Auckland and Sydney.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.quickfixn.com/pipermail/quickfixn-quickfixn.com/attachments/20120402/c253619c/attachment.htm>


More information about the Quickfixn mailing list