把你的代码发给我吧,我帮你写写注释。 [email protected]

解决方案 »

  1.   

    extern "C" unsigned __declspec(dllexport) __cdecl SendSMS(void *p_DestNo, void *p_SvcType,
        unsigned p_Length, void *p_Content, unsigned char p_TpUid, unsigned char p_TpUdhi,
        void *p_ScheduleTime, unsigned short p_ExpireTime, unsigned short p_Times, unsigned short p_Interval,
        void *p_ChargeNo);
    UINT CUsedllDlg::ThreadProc(void* pData)
    {  unsigned p_SPCode = 0, p_Length = 0; 
       word p_ExpireTime, p_Times, p_Interval;
       byte  p_TpPid, p_TpUdhi;
       char p_DestNo[22], p_SvcType[11], p_Content[400];
       char p_ScheduleTime[15], p_ChargeNo[22];
       CString tempstr, cs_now;
       int i = 0, j = 0, ii = 0, kk = 0, jj = 0;
       int retcode = 0;
       unsigned char Buffer[4096];
       Receive *rec;
       
       p_SPCode = 100;
       p_ExpireTime = 1440;
       //p_ExpireTime = 5;
       p_Times = 1;
       p_Interval = 0;
       p_TpPid = 0;
       p_TpUdhi = 0;
       memset(p_SvcType, 0, 11);
       memset(p_Content, 0, 400);
       memset(p_ScheduleTime, 0, 15);
       memset(p_ChargeNo, 0, 22);
       memset(p_DestNo, 0, 22);
       sprintf(p_DestNo, "%s", m_pThis->m_DestNum);
       //strcpy(p_SvcType, "ETOTTEST");
       sprintf(p_SvcType, "%s", m_pThis->m_Svr_Type);
       sprintf(p_Content, "%s", m_pThis->m_Content);   
       p_Length = strlen((char*)p_Content); 
    CTime ct_now = CTime::GetCurrentTime();
    cs_now = ct_now.Format("%Y%m%d%H%M%S"); 
       sprintf(m_pthis->m_destnum,"%s",p_destno); 
       //strcpy(p_ChargeNo, "0");
       sprintf(p_ChargeNo, "%s", m_pThis->m_ChargeNum);   
       m_pThis->m_Flag = 0;
       for(i=0; i<m_pThis->m_Count; i++)
       {
       
       if(m_pThis->m_Flag) return 0;
       int oid = SendSMS(p_DestNo, p_SvcType, p_Length, p_Content, p_TpPid, p_TpUdhi,
     cs_now.GetBuffer(cs_now.GetLength()), p_ExpireTime, p_Times, p_Interval, p_ChargeNo);    
    cs_now.ReleaseBuffer();
    tempstr.Format("%d",oid);
    m_pThis->m_Oid.SetWindowText(tempstr);