Example #1
0
int  MdApiImpl::ReqUserLogin(CThostFtdcReqUserLoginField *pReqUserLoginField, int nRequestID)
{
    static BYTE bLoginPkt[FTD_HDRLEN] = { FTDTypeFTDC,0,0,0xea,1,0,8,CHAIN_LAST,0,0,0,0,0x30,0,0,0,0,0,0,3,0,0xd4,0,0,0,0,0x10,2,0,0xbc};
    DWORD iLen = FTD_HDRLEN+sizeof(CThostFtdcReqUserLoginField)+sizeof(bMdQuick);
    m_bPktSend.resize(iLen);

    *(DWORD*)(bLoginPkt+0x16) = htonl(nRequestID);

    GetToday(pReqUserLoginField->TradingDay,9);
    //strcpy(pReqUserLoginField->BrokerID, m_sBkrId);
    if (!strlen(pReqUserLoginField->UserProductInfo))
    {
        StringCbCopyA(pReqUserLoginField->UserProductInfo,11,PROD_INFO);
    }
    if (!strlen(pReqUserLoginField->InterfaceProductInfo))
    {
        StringCbCopyA(pReqUserLoginField->InterfaceProductInfo,11,API_INFO);
    }
    if (!strlen(pReqUserLoginField->ProtocolInfo))
    {
        StringCbCopyA(pReqUserLoginField->ProtocolInfo,11,PROT_INFO);
    }

    StringCbCopyA(pReqUserLoginField->MacAddress,21,m_sMac);

    memcpy(&m_bPktSend[0],bLoginPkt,FTD_HDRLEN);
    memcpy(&m_bPktSend[FTD_HDRLEN],pReqUserLoginField,sizeof(CThostFtdcReqUserLoginField));
    memcpy(&m_bPktSend[FTD_HDRLEN+sizeof(CThostFtdcReqUserLoginField)],bMdQuick,sizeof(bMdQuick));

    return SendPkt(&m_bPktSend[0],iLen);
}
Example #2
0
void CDxMonthPicker::OnButtonClick(UINT nID)
{
    if (nID == XTP_IDS_DATEPICKER_TODAY)
    {
        COleDateTime dt;
        GetToday(dt);
        EnsureVisible(dt);
        Select(dt);
    }
}