SMS_Sending_Example_v1_4.zip

  • zxliu323
    了解作者
  • Visual C++
    开发工具
  • 18KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • 1 积分
    下载积分
  • 39
    下载次数
  • 2005-09-10 15:21
    上传日期
send SMS example. send SMS example.
SMS_Sending_Example_v1_4.zip
  • gdsms
  • group
  • gdsms.SIS
    6KB
  • ABLD.BAT
    300B
  • bld.inf
    38B
  • gdsms.aif
    2.1KB
  • gdsms.mmp
    1KB
  • gdsms.pkg
    465B
  • inc
  • gdsms.hrh
    262B
  • gdsms.h
    3.1KB
  • doc
  • src
  • gdsms.rss
    2.2KB
  • gdsms.cpp
    30.1KB
  • www.pudn.com.txt
    218B
内容介绍
/* GDSMS.CPP - source file for GDSMS application */ #include <txtrich.h> // for CRichText #include <smscmds.h> // for TSmsMtmCommand (asynchronous sms commands) #include <eikenv.h> // for CEikonEnv #include <smuthdr.h> // for CSmsHeader #include <smsetdlg.h> // for CSmsAddServiceCentreDialog #include <comabs.h> // for CCommandAbsorbingControl #include <mtclreg.h> // for CClientMtmRegistry #include <smutset.h> // for CSmsMessageSettings #include "gdsms.h" // own definitions #include "gdsms.hrh" // own resource header #include <gdsms.rsg> // this is the content of the message _LIT(KGDSMSTag, "GDSM"); // Own constants const TUid KUidGDSMS = { 0x101F3CD9 }; // GDSMS application UID const TInt KTagLength = 4; // length of our message tag const TInt KMaxTelephoneNumberLength = 30; // maximum length for a gsm number // // CGDSMSTelNumDialog // /* ----------------------------------------------------------------------------- CGDSMSTelNumDialog::CGDSMSTelNumDialog() C++ constructor Return values: None ----------------------------------------------------------------------------- */ CGDSMSTelNumDialog::CGDSMSTelNumDialog(TDesC& aRecipientsTelNum) : iRecipientsTelNum(&aRecipientsTelNum) // Initialise data { } /* ----------------------------------------------------------------------------- CGDSMSTelNumDialog::PreLayoutDynInitL() Function for doing pre layout events. Return values: None ----------------------------------------------------------------------------- */ void CGDSMSTelNumDialog::PreLayoutDynInitL() { (static_cast<CEikTelephoneNumberEditor*>(Control(EGDSMSTelNumEditor)))->SetNumberL(*iRecipientsTelNum); } /* ----------------------------------------------------------------------------- CGDSMSTelNumDialog::OkToExitL() Function for doing on exit events. Return values: ETrue or EFalse ----------------------------------------------------------------------------- */ TBool CGDSMSTelNumDialog::OkToExitL(TInt /*aButtonId*/) // Function for doing on exit events { TBuf<KMaxTelephoneNumberLength> recipientsTelNum; (static_cast<CEikTelephoneNumberEditor*>(Control(EGDSMSTelNumEditor)))->GetNumber(recipientsTelNum); if (recipientsTelNum.Length()==0) { iEikonEnv->InfoMsg(R_GDSMS_TEL_NUMBER_DIALOG); return EFalse; } (static_cast<HBufC*>(iRecipientsTelNum))->Des()=recipientsTelNum; // Number is set to iRecipientsTelNum return ETrue; } // // CGDSMSAppView // /* ----------------------------------------------------------------------------- CGDSMSAppView::NewL() 2nd phase construction. Return values: CGDSMSAppView* ----------------------------------------------------------------------------- */ CGDSMSAppView* CGDSMSAppView::NewL(const TRect& aRect) { CGDSMSAppView* self=NewLC(aRect); CleanupStack::Pop(); // self return self; } /* ----------------------------------------------------------------------------- CGDSMSAppView::NewLC() 2nd phase construction. Created object is put into CleanupStack before calling ConstructL(). Return values: CGDSMSAppView* ----------------------------------------------------------------------------- */ CGDSMSAppView* CGDSMSAppView::NewLC(const TRect& aRect) { CGDSMSAppView* self = new(ELeave) CGDSMSAppView(); CleanupStack::PushL(self); self->ConstructL(aRect); return self; } /* ----------------------------------------------------------------------------- CGDSMSAppView::CGDSMSAppView() C++ constructor ----------------------------------------------------------------------------- */ CGDSMSAppView::CGDSMSAppView() { } /* ----------------------------------------------------------------------------- CGDSMSAppView::ConstructL() 2nd phase constructor. Return values: CGDSMSAppView* ----------------------------------------------------------------------------- */ void CGDSMSAppView::ConstructL(const TRect& aRect) { CreateWindowL(); SetRect(aRect); ActivateL(); } /* ----------------------------------------------------------------------------- CGDSMSAppView::Draw() Simple Draw method (only clears the application area). ----------------------------------------------------------------------------- */ void CGDSMSAppView::Draw(const TRect& /*aRect*/) const { CWindowGc& gc = SystemGc(); gc.Clear(); } // // CGDSMSAppUi // /* ----------------------------------------------------------------------------- CGDSMSAppUi::ConstructL() 2nd phase constructor ----------------------------------------------------------------------------- */ void CGDSMSAppUi::ConstructL() { BaseConstructL(); // init this AppUi with standard values iAppView=CGDSMSAppView::NewL(ClientRect()); iRecipient=HBufC::NewL(KMaxTelephoneNumberLength); // for recipient sms number iMsvId = NULL; // MsvId for keeping track of the message server entries. // Create CMsvSession iSession = CMsvSession::OpenAsyncL(*this); // new session is opened asynchronously // CompleteConstructL() is called when async finishes } /* ----------------------------------------------------------------------------- CGDSMSAppUi::~CGDSMSAppUi() Destructor. ----------------------------------------------------------------------------- */ CGDSMSAppUi::~CGDSMSAppUi() { delete iAppView; delete iRecipient; delete iMtm; delete iMtmReg; iMsvId = NULL; delete iSession; // session must be deleted last (and constructed first) } /* ----------------------------------------------------------------------------- CGDSMSAppUi::CompleteConstructL() Creates client MTM registry when session is ready for use. This completes model construction and is called after 'server ready' event is received after async opening of CMsvSession. ----------------------------------------------------------------------------- */ void CGDSMSAppUi::CompleteConstructL() { // We get a MtmClientRegistry from our session // this registry is used to instantiate new mtms. iMtmReg = CClientMtmRegistry::NewL(*iSession); // notify the user with a InfoWin iEikonEnv->InfoWinL(_L("Construction"),_L("Server session opened.")); } /* ----------------------------------------------------------------------------- CGDSMSAppUi::HandleSessionEventL() Handles session event observer and calls event handling functions in observer. Note that if additional session event handlers are defined in the session, they are called before this function (as this is the main session observer). The type of event is indicated by the value of aEvent. The interpretation of the TAny arguments depends on this type. For most event types, the action that is taken, for example, updating the display, is client-specific. All clients though should respond to EMsvCloseSession and EMsvServerTerminated events. ----------------------------------------------------------------------------- */ void CGDSMSAppUi::HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* /*aArg3*/) { switch (aEvent) { c
评论
    相关推荐
    • sms-example.zip
      使用標準AT指令 現在只能支持PDU模式(Text模式太簡陋)! 支持7_Bit 和 UCS2 編碼 集成了串口(spcomm) 只需要簡單的配置幾個參數就可以收發短信了
    • SMS_Example.rar
      本工程是一个关于短消息接口的应用,提供了短信的编辑,发送,监听,删除等各种常见操作的应用。
    • Example_SMS.zip
      通过android.telephony.SmsManager短线管理器,对短信就行拆分处理,再通过sendTextMessage()将短信发送出去。 当然,权限是必不可少的。 android.permission.SEND_SMS
    • Send SMS example 2009.zip
      发送短信VI,可以输入手机号码、邮件地址、服务器等信息,实现电脑给手机发短信
    • Android-Send-SMS-Example.zip
      Android-Send-SMS-Example Android-Send-SMS-Example Android-Send-SMS-Example
    • sms_example.rar
      sms_example.rar 输入1: mobile: 手机号码 ' 输入2: sms : 用户发送的短信的全部内容 ' 输入3: userid: 使用这个程序的M2P的注册USERID ' 输出1: “<state>0”:表示正常输出的状态标志,所有M2P接口返回的信息...
    • S60_Platform_SMS_Example_v2_1_en.zip
      This C++ example demonstrates programmatical handling of SMS messages. Messages can be sent from the application and they can be received directly into the application (that is, catching incoming ...
    • twilio-sms-example-java
      twilio-sms-example-java 该应用程序使用 运行测试 $ mvn clean test 部署到Google App Engine $ ./deploy-google-appengine.sh 建立容器图片 $ mvn clean package jib:build 构建到Docker守护程序 $ mvn clean ...
    • SMS.RAR
      Send SMS message example
    • sms.zip
      example for sms application