Re: [Quickfix-developers] Question about Logon to server with username and password
Brought to you by:
orenmnero
From: Cheng S. <che...@gm...> - 2019-10-17 02:39:15
|
Grant, thanks a lot for your quick reply. You are right. Inside Application.h, the toAdmin() function is already defined. So I just changed that to declaration and it works now! Shanbao On Wed, Oct 16, 2019 at 2:15 PM Grant Birchmeier <gbi...@co...> wrote: > What's your .h look like? Did you declare it toAdmin to be "virtual"? > > Your username/password setters look fine to me. > > On Wed, Oct 16, 2019 at 12:51 PM Cheng Shanbao <che...@gm...> > wrote: > >> QuickFIX Documentation: http://www.quickfixengine.org/quickfix/doc/html/ >> >> Hi All, >> >> I am using the tradeClient example coming from the quickfix download. I >> can run the initiator successfully. Now I need to logon to the remote >> server/broker with requirement of username and password. >> >> After reading a lot of questions and answers on this mailist, my >> understanding is that I have to provide information of username and >> password inside the function of toAdmin(). >> >> In the Application.cpp, there is already toApp() function. So I wrote my >> own toAdmin() function as below. But the VC++ studio gave me the error: >> function 'void Applcation:toAdmin(FIX:: :Message& message, const >> FIX::SessionID& sessionID) already has a body. >> >> I have two questions here: >> 1. why I got such an error? I tried putting the code inside toApp() >> function, but it couldn't connect to the server. >> 2. Is my implementation of providing username and password correct? >> >> Any reply will be highly appreciated! >> >> -- >> Best regards >> >> Shanbao >> >> The below is the code inside the "Application.cpp". >> >> void Application::toAdmin(FIX::Message& message, const FIX::SessionID& >> sessionID) >> { >> try >> { >> //SenderSubID and compony ID >> message.getHeader().setField(50, "107225"); >> message.getHeader().setField(115, "QUOTES"); >> //Username&Password >> message.setField(553, "107225"); >> message.setField(554, "12345"); >> } >> catch (FIX::FieldNotFound&) {} >> std::cout << std::endl >> << "toAdmin OUT: " << message << std::endl; >> } >> _______________________________________________ >> Quickfix-developers mailing list >> Qui...@li... >> https://lists.sourceforge.net/lists/listinfo/quickfix-developers > > > > -- > Grant Birchmeier > *Connamara Systems, LLC* > *Made-To-Measure Trading Solutions.* > Exactly what you need. No more. No less. > http://connamara.com > -- Best regards Cheng Shanbao |