Re: [Quickfix-developers] Error converting FIX40::NewOrderList to FIX::Message(modification)
Brought to you by:
orenmnero
From: Parag T. <PT...@tc...> - 2003-08-14 05:52:02
|
Sorry , My earlier query was not right. Rewiriting it considering your solution. Your solution is acceptable to me. I want little modification as shown below Your Solution is: FIX::Message getNewOrderList() { return FIX40::NewOrderList newOrderList( FIX::ListID(listID), FIX::ListSeqNo(ListSeqNo), FIX::ListNoOrds(ListNoOrds), FIX::ClOrdID(clOrdID), FIX::HandlInst(chHandlInst), FIX::Symbol(symbol), FIX::Side(chSide), FIX::OrderQty(orderQty), FIX::OrdType(chOrdType)); } My modification: FIX::Message getNewOrderList() { FIX::Message message; try { FIX40::NewOrderList newOrderList( FIX::ListID(listID), FIX::ListSeqNo(ListSeqNo), FIX::ListNoOrds(ListNoOrds), FIX::ClOrdID(clOrdID), FIX::HandlInst(chHandlInst), FIX::Symbol(symbol), FIX::Side(chSide), FIX::OrderQty(orderQty), FIX::OrdType(chOrdType)); message =newOrderList; //Here i get error for converting to FIX::Message } catch(...) { MyExcep excep; throw excep; } return message } I am not returning from try block as I want to avoid warning ::"not all control returns value" ----- Forwarded by Parag Tawde/MBY/NOTES on 08/14/2003 10:29 AM ----- Oren Miller <orenmnero@yahoo. To: Parag Tawde <PT...@tc...>, com> qui...@li... cc: 08/14/2003 02:09 Subject: Re: [Quickfix-developers] Error converting AM FIX40::NewOrderList to FIX::Message You're a java developer arn't you :) Ok, there are a few problems here. The big one is that you're trying to copy a pointer into an object without dereferencing it. Also, you are allocatting on the heap without deleting, which will give you a memory leak. In any case, if you have a need for such a method, you could simply write it like this. FIX::Message getNewOrderList() { return FIX40::NewOrderList newOrderList( FIX::ListID(listID), FIX::ListSeqNo(ListSeqNo), FIX::ListNoOrds(ListNoOrds), FIX::ClOrdID(clOrdID), FIX::HandlInst(chHandlInst), FIX::Symbol(symbol), FIX::Side(chSide), FIX::OrderQty(orderQty), FIX::OrdType(chOrdType)); } __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com |