手机发送短信问题

Mona   2009-7-29 11:27 楼主
要在使用windows mobile 6.0 操作系统的手机上,使用VC编写一个能够向其他手机发送手机短信的程序,主要需要调用哪些函数呢?这些函数又在哪些头文件里?

还请各位大牛赐教,不胜感激!

回复评论 (7)

RIL
SMS API
点赞  2009-7-29 11:49
引用: 引用 1 楼 91program 的回复:
RIL
SMS API


能说得具体一些吗?比如说函数的具体参数等等,才开始接触这些,比较菜,谢谢了!
点赞  2009-7-29 13:49
lz用goole "Windows Mobile开发 短信",比在这里问更快捷。

点赞  2009-7-29 14:11
函数是要自己写的,主要编写怎么向GSM模块发AT命令,就可以实现发短信,可以查找相关发短信的AT命令,我也在做这个,不过做出了的,嘿嘿
点赞  2009-7-29 14:24
引用: 引用 4 楼 dream_meng 的回复:
函数是要自己写的,主要编写怎么向GSM模块发AT命令,就可以实现发短信,可以查找相关发短信的AT命令,我也在做这个,不过做出了的,嘿嘿

lz问的是Windows Mobile,那是有直接API的(RIL, SMS),即使看MSDN也很清晰。比做wince的要便利了千万倍了。
点赞  2009-7-29 14:43
memset(&rilMsg, 0, sizeof(RILMESSAGE));

        rilMsg.cbSize = sizeof(RILMESSAGE);
       
        rilMsg.dwType = RIL_MSGTYPE_OUT_SUBMIT;
        rilMsg.dwParams |= RIL_PARAM_M_TYPE;

        rilMsg.dwFlags = RIL_MSGFLAG_REPLYPATH;
        rilMsg.dwParams |= RIL_PARAM_M_FLAGS;

//        StringToRILAddress(L"15818682612", RIL_ADDRTYPE_UNKNOWN, &rilMsg.msgOutSubmit.raDestAddress);
        rilMsg.msgOutSubmit.raDestAddress.cbSize = sizeof(RILADDRESS);
        rilMsg.msgOutSubmit.raDestAddress.dwType = RIL_ADDRTYPE_UNKNOWN/*RIL_ADDRTYPE_NATIONAL*/;
        rilMsg.msgOutSubmit.raDestAddress.dwNumPlan = RIL_NUMPLAN_TELEPHONE/*RIL_NUMPLAN_UNKNOWN*/;
        wcscpy(rilMsg.msgOutSubmit.raDestAddress.wszAddress, L"15815369852");
        rilMsg.msgOutSubmit.raDestAddress.dwParams = RIL_PARAM_A_ALL;
        rilMsg.dwParams |= RIL_PARAM_M_DESTADDRESS;

        rilMsg.msgOutSubmit.dwProtocolID = RIL_MSGPROTOCOL_SMETOSME;
        rilMsg.dwParams |= RIL_PARAM_M_PROTOCOLID;

        rilMsg.msgOutSubmit.dwVPFormat = RIL_MSGVP_NONE;
        rilMsg.dwParams |= RIL_PARAM_M_VPFORMAT;

        rilMsg.msgOutSubmit.rmdDataCoding.cbSize = sizeof(RILMSGDCS);
        rilMsg.msgOutSubmit.rmdDataCoding.dwAlphabet = RIL_DCSALPHABET_UCS2;
        rilMsg.msgOutSubmit.rmdDataCoding.dwFlags = RIL_DCSFLAG_NONE;
        rilMsg.msgOutSubmit.rmdDataCoding.dwType = RIL_DCSTYPE_GENERAL/*RIL_DCSTYPE_MSGCLASS*/;
        rilMsg.msgOutSubmit.rmdDataCoding.dwMsgClass = RIL_DCSMSGCLASS_1;
        rilMsg.msgOutSubmit.rmdDataCoding.dwParams = RIL_PARAM_MDCS_FLAGS | RIL_PARAM_MDCS_ALPHABET | RIL_PARAM_MDCS_TYPE | RIL_PARAM_MDCS_MSGCLASS;
        rilMsg.dwParams |= RIL_PARAM_M_DATACODING;

        wcscpy((TCHAR *)rilMsg.msgOutSubmit.rgbMsg, TEXT("测试"));
        rilMsg.dwParams |= RIL_PARAM_M_MSG;

        rilMsg.msgOutSubmit.cchMsgLength = 14;
        rilMsg.dwParams |= RIL_PARAM_M_MSGLENGTH;


        m_hr = RIL_SendMsg(m_ril, &rilMsg, NULL);
点赞  2009-7-29 15:09
up
点赞  2009-7-29 16:42
电子工程世界版权所有 京B2-20211791 京ICP备10001474号-1 京公网安备 11010802033920号
    写回复