Changed functionality in this version  Enhanced support for VGA screens

Release Bulletin PocketBuilder™ 2.0.1

SMS receive functionality

PocketBuilder 2.0 added the ability to send SMS messages from an application. With PocketBuilder 2.0.1, you can now receive SMS messages in PocketBuilder applications running on Windows Mobile 2003 platforms.

Deploying a DLL with hooks into the SMS processor

PocketBuilder provides a shim DLL, PKSMS20.DLL, that contains a COM object that hooks into the SMS processor. The DLL should be copied to the \Windows directory of a Pocket PC device or the \Storage\Windows directory of a Smartphone device. You must register the DLL with the operating system, then perform a soft reset on the device.

You can deploy the DLL along with registry settings in the CAB file you create for a customer application. The DLL is not part of the standard CAB file that you generate from the PocketBuilder Project painter. You can use the Enhanced CAB Generation tool to add the PKSMS20.DLL file to the CAB file, or you can add it manually.

Registering the shim DLL

To register the DLL, you can use the Enhanced CAB Generation tool (see “Support for SMS receiving in generated CAB files”) or either of the following approaches:

First you register the server:

[HKEY_CLASSES_ROOT\CLSID\{CA08D891-1E24-4c69-A313-453B1120E558}\InProcServer32] @="PKSMS20.dll"
[HKEY_CLASSES_ROOT\CLSID\{CA08D891-1E24-4c69-A313-453B1120E558}]ReadOnly = dword: # 

Next you register the inbox processor:

[HKEY_LOCAL_MACHINE\Software\Microsoft\Inbox\Svc\
SMS\Rules]{CA08D891-1E24-4c69-A313-453B1120E558} = dword:1

NoteUnregistering a DLL You can unregister the DLL by calling DLLUnregisterServer from your application. You must perform a soft reset after you unregister a DLL.

Support for SMS receiving in generated CAB files

You access the Enhanced CAB Generation tool on the Tool tab of the New dialog box. The PocketBuilder Options tab page in the Enhanced CAB Generation tool has check boxes that let you include the following in a CAB file that you deploy to a device:

New values for Open function argument

In PocketBuilder 2.0.1, the msgmodes argument of the Open function of the SMSSession object accepts values that enable the object to receive notification of incoming messages. The syntax for the Open function remains the same as in PocketBuilder 2.0:

SMSSessionname.Open ( smsproto, msgmodes )

Valid values for the msgmodes argument are now:

In order to receive SMS messages in an application, you must set the msgmodes argument in the Open call for the SMSSession object to 2 or 3.

SMSSession IncomingMessage event

In PocketBuilder 2.0.1, an IncomingMessage event has been added to the SMSSession object. This event occurs when an SMSSession object that is open for receiving messages is notified of an incoming SMS message.

All instantiated SMSSession objects listening for messages are notified of an incoming SMS message. PocketBuilder can prevent the message from displaying in the SMS inbox if you set the IncomingMessage event to return true. If any SMSSession object requests deletion of the message by returning true for the IncomingMessage event, PocketBuilder will attempt to delete the message, but only after all SMSSession objects have processed the message.

NoteDeletion of messages is dependent on registry setting PocketBuilder applications can receive notification of an SMS message only after you register the shim DLL, PKSMS20.DLL, on your device. The ReadOnly registry attribute for the DLL must be set to 0 before PocketBuilder can delete an SMS message. For information on registering the DLL and the ReadOnly registry attribute, see “Registering the shim DLL”.

The IncomingMessage event is synchronous with the operating system processing SMS messages. Therefore you should not include code that prompts for user input, or perform any lengthy operation in the script for this event.

Example

The following code in the IncomingMessage event determines whether an incoming SMS message is placed in the SMS inbox or is deleted. The determination is based on whether or not the message contains the text “top secret”:

// If the message contains "top secret" it will deleted.
// Otherwise, it is placed in the inbox.

if POS(SMSMsg.text, "top secret") <> 0 then
	// delete this e-mail and notify user of deletion
   //  in a MultiLineEdit control
	mle_status.text += "~r~nWill be deleted.~r~n"
	return TRUE
end if

// allow to go into the inbox
return FALSE




Copyright © 2005. Sybase Inc. All rights reserved. Enhanced support for VGA screens

View this release bulletin as PDF