要在使用windows mobile 6.0 操作系统的手机上,使用VC编写一个能够向其他手机发送手机短信的程序,主要需要调用哪些函数呢?这些函数又在哪些头文件里?
还请各位大牛赐教,不胜感激!
引用: 引用 1 楼 91program 的回复:
RIL
SMS API
能说得具体一些吗?比如说函数的具体参数等等,才开始接触这些,比较菜,谢谢了!
lz用goole "Windows Mobile开发 短信",比在这里问更快捷。
函数是要自己写的,主要编写怎么向GSM模块发AT命令,就可以实现发短信,可以查找相关发短信的AT命令,我也在做这个,不过做出了的,嘿嘿
引用: 引用 4 楼 dream_meng 的回复:
函数是要自己写的,主要编写怎么向GSM模块发AT命令,就可以实现发短信,可以查找相关发短信的AT命令,我也在做这个,不过做出了的,嘿嘿
lz问的是Windows Mobile,那是有直接API的(RIL, SMS),即使看MSDN也很清晰。比做wince的要便利了千万倍了。
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);