[Quickfix-users] getHeader() problem with quickfix.1.5.0
Brought to you by:
orenmnero
From: Christodoulou, C. D (london) <chr...@ml...> - 2003-09-24 17:52:41
|
Hi I have installed quickfix 1.5.0 on Windows using Visual Studio on XP machine. I am running the .NET version (managed code) since I am using C# to talk to the quickfix dll. I am trying to get the MsgType from a NewOrderSingle message, however, whenever I try to return the MsgType I get a compilation error: -- Cannot implicitly convert type 'QuickFix.Message.Header' to 'QuickFix42.Header' Code example: // Create a FIX request NewOrderSIngle newOrder = new NewOrderSingle(); Header header = newOrder.getHeader(); <== compile error QuickFix.MsgType msgType = new QuickFix.MsgType(); QuickFix.StringField strType = Router.getField(msgType); The getHeader() is declared as follows: namespace QuickFix42 { public __gc class Header : public QuickFix::Message::Header { Header(QuickFix::Message* message) : QuickFix::Message::Header(message) {} NET_FIELD_SET(BeginString); NET_FIELD_SET(BodyLength); NET_FIELD_SET(MsgType); ... } ... Header* getHeader() { return dynamic_cast<Header*>(QuickFix::Message::getHeader()); } } Therefore I am expecting it to return a QuickFix42 header, however it actually thinks it's returning a QuickFix header which results in the above compilation error. If I use the QuickFix.Message.Header then the derived MsgType is not available to me. Has anyone got any ideas? Also, I am a little confused as to why getHeader is returning a pointer. Thanks Chris |