Cemapi Practice strategy-Outline

Source: Internet
Author: User

Http://blog.csdn.net/depraved_survival/archive/2009/03/09/3969013.aspx

Cemapi Practice strategy-Outline

By Wu chunlei

QQ: 819543772

Email: wuchunlei@163.com

Preface:

Recently, we are developing mobile phone applications based on the Windows moblie 5.0 platform. The cemapi library is used to develop text message-related application modules. Since we have been developing business logic in the past, we have little knowledge about cemapi. During the redevelopment process, I encountered some inevitable problems and checked a lot of information on the Internet. I was surprised to find that such a mature technology, the introduction is so rare and unsystematic, except for the article "cemapi text message development instance explanation", which was boring for two years ago, I can hardly find an article about how to use the cemapi library. I can also see from my questions at the csdn and msnd development forums in China and the speed and quality of feedback, most mobile phone developers in China (friends who are often active on csdn) do not have a system or in-depth understanding of SMS development technology on mobile platforms. Currently, on the Internet, in addition to some information available for access on msdn, some valuable Chinese documents in China are the cemapi text message development example of Bored customers. in addition to being able to conduct in-depth research and create such an article on behalf of the boring man with rare reference materials, I would like to express my admiration for it, due to the lack of systems, too many good things are discarded by developers, and too many developers have taken the same detour. This article is based on existing articles on the Internet and msdn materials. It systematically sorts out the basic knowledge about the technologies used to develop text message applications using cemapi, I have made a detailed arrangement on the problems and solutions I encountered during the development process, hoping to help WM developers. Of course, no article can fully include a certain technology, and this article is no exception. If this article does not mention but is relatively important, or there are errors in this article. I hope that my friends who have read this article can tell me that I hope this article will gradually become a whitepaper FOR THE cemapi library for future reference. My contact information is as follows:

QQ: 819543772

Email: wuchunlei@163.com

MSN: wuchunlei@163.com

Introduction:

This article mainly introduces how to use the cemapi library provided by Microsoft, and makes a systematic arrangement of the information that can be collected on the network. This article first introduces preparations for using the cemapi library to develop text message applications, including selection and setup of the development environment, selection and download of the Platform SDK, and use of cellular emulator, and how to test the text message application I developed. The following sections describe common objects and interfaces in cemapi, and describe how to use these objects to establish connections with mapi, SMS repository, and specific mailboxes, and how to obtain, create, move, copy, and monitor text messages in a specific mailbox. Finally, this article studies and analyzes the mapirule example in the wm5.0 SDK to implement the blocking operation on SMS arrival. The outline list is as follows:

Preface:

I. Preparations

1. Development Environment and device Platform

A) download and install

B) how to use cellular emulator to test my sms Application

C) if wm5.0 is used, how can I test my program?

2. How to import the cemapi Library

3. initialize and release mapi

4. source program in this section

2. Establish a connection with the SMS mailbox

1. Session interface imapisession

2. How to Create a session with mapi

3. How to terminate the session with the SMS (email) system and release the session object

4. SMS (email) warehouse interface imsgstore

5. Establish a connection with the SMS Repository

6. release an imsgstore object

7. Establish a connection with a specific mailbox to obtain the imapifolder object of the specific mailbox Interface

8. Release the folder object

9. The source program involved in this section

3. Short Messages in the Operation mailbox

1. Composition of Short Messages in Windows Mobile

2. iMessage Interface

3. sizedsproptagarray macro

4. Get an original short message from a specific mailbox

5. Release the iMessage object.

6. parse the original Short Message

A) Get the body

B) obtain the sender's phone number

C) obtain the recipient's phone number

D) Get the Short Message ID

7. Get the Short Message ID

8. Create a short message in the specific mailbox

A) create an empty message

B) add a contact

C) Add attributes such as body, Sender number, and Creation Time

D) Don't forget savechange.

E) Why is the content of the short message written on the topic empty?

9. delete a short message from a specific mailbox

10. Move the short message to a specific mailbox

11. Mark the information in inbox as read or unread

12. The source program involved in this section

4. Send Short Messages

1. tmail.exe Process

A) The Listener is a tmail.exe process.

B) whether the execute tmail.exe process is running

C) Kill the tmail.exe Process

D) Start the tmail.exe process.

2. Use tmail.exe to send a short message

3. How to block the system prompts after the text message is sent

4. source program

5. monitor changes in short messages in the mailbox

1. I have a question: how can I learn the changes of short messages in the system mailbox in real time and establish a loop to traverse each mailbox ~~

2. Use the imapiadvisesink interface to solve this problem.

6. How to intercept arriving Short Messages

1. What is mapirule? Where can I get it?

2. I want to deploy it on the wm6.0 platform first to see the results. What should I do?

A) Compile mapirule

B) how to register the COM component (what is the COM component is not covered in this article)

I. Method 1: manually enter registration information in the Registry

Ii. Method 2: configure the INF file in the cab installation package

Iii. Method 3: Call the dllregisterserver function provided by mapirule.

C) uninstall the component.

I. manually delete Registry Information

Ii. Call the dllunregisterserver function provided in mapirule

D) How can I determine whether the registration is successful?

E) How do I determine that mapirule. dll has been loaded by the tmail process?

F) test whether the component works properly.

G) Why does it not work after I have successfully registered it?

I. Check whether the guid conflicts with other components.

Ii. Certificate pfx

Iii. Verify that the program has registered mapirule for the tmail.exe process.

3. I don't know where to start with so many codes? (Don't worry. We only need to know the key points)

A) What is guid? How to generate a new guid?

B) getclsobject Function

C) How does one intercept text messages? (Cmapiclient interface, processmessage method)

D) Where does the intercepted text message go? (Deletemessage method)

4. How can I obtain intercepted short messages in my own program?

A) Ideas for external programs to obtain intercepted message information (memory ing file, three SMS methods)

B) Some source programs that Microsoft has provided to me to implement this idea can be obtained directly from the receivingsms demo. (

C) if you are a CSHARP developer, congratulations, receivingsms is a demo of CSHARP calling mapirule to intercept short messages. You can use it directly. If you are a C ++ developer, we still need to do some work.

5. Source programs involved in this section

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.