Download ActiveXperts SMS and MMS Toolkit 5.1  (6826 KB - .exe file)
Download Manual  (623 KB - .htm file)
Using SMS and MMS Toolkit with Borland C++ Builder (MM1 Connection)
The SMS and MMS Toolkit is a software development kit (SDK) to enhance an application or script with SMS, MMS and Pager functionality.
An SMS messages can be sent using a GSM/GPRS modem, an SMPP provider, an HTTP compliant SMS provider or using a standard dialup or fixed-line SMS modem.
An MMS messages can be sent via a GSM/GPRS modem (MM1), an SMTP server (MM4) or an XML/SOAP compliant provider (MM7).
SMS features:
- Send and receive numeric- and alphanumeric text SMS messages
- Verify delivery of outgoing SMS messages
- Support for multimedia SMS messages, including ringtones, pictures and logo's
- Support for WAP Push, WAP Bookmarks, vCards, voicemail/e-mail/fax/MMS indications
- Support for Unicode, to support foreign languages like Chinese, Turkisch, etc.
- Support for multi-part messages, to allow messages longer than 160 characters
- Support for GSM modems, GSM phones, SMS/HTTP providers, SMPP (Short Message Peer to Peer) providers, TAP/XIO and UCP dial-in SMSC providers
- Support Multi-threading environments. The component is thread-safe, which means it can be used in a multi-threaded environment
- Samples included for various development platforms: MS Visual Basic, MS Visual Basic .NET, MS Visual C++, MS Visual Studio C# .NET, ASP, ASP .NET, Borland Delphi, Borland C++ Builder, ColdFusion and more
MMS features:
- Support for many multimedia formats incl.: JPG, GIF, PNG, BMP, WBMP, TIF, WAV, MP3, MIDI, AC3, GP3, AVI, MPG, MP4, VCARD, VCALENDAR, JAR and more
- Support for MM1 (MMS over WAP), MM4 (MMS over SMTP) and MM7 (MMS over HTML/SOAP)
Pager features:
- Send alpha-numeric Pager messages through SNPP
This document describes how the SMS and MMS Toolkit can be integrated into Borland C++ Builder projects.
Step 1: Download and install the SMS and MMS Toolkit
Download the the SMS and MMS Toolkit from the ActiveXperts Download Site and start the installation.
The installation guides you through the installation process.
Step 2: Create a new C++ Builder Project
Launch Borland C++ Builder (for instance 'Borland C++ Builder 6') from the Start menu.
Choose 'New' from the 'File' menu and select 'Application'.
A new Form is displayed in the workspace.

(Click on the picture to enlarge)
Step 3: Refer to the SMS and MMS Toolkit Library
Now that a new project has been created, you must add a reference to MMS Toolkit in the project to be able to use the SMS and MMS Toolkit object.
To do so, choose 'Import Type Library...' from the 'Project' menu. The Import Type Library' dialog appears.

(Click on the picture to enlarge)
In the upper selection box, select 'MMS Toolkit 2.1 Type Library' and click 'Create Unit':
The interface code is generated now and is shown in the AXmsCtrl_TLB.cpp and AXmsCtrl_TLB.h tab of the project.
Step 4: Declare and create the object
From the Project Manager, open Unit1.h and add include the AXmsCtrl_TLB.h file to refer to the SMS and MMS Toolkit library:

(Click on the picture to enlarge)
In the 'private' or 'public' section, declare the following objects:
TCOMIMmsProtocolMm1 m_objMm1Protocol;
TCOMIMmsMessage m_objMmsMessage;
TCOMIMmsSlide m_objMmsSlide;
You can now create the objects, for instance in the 'FormCreate' event handler or the class constructor:
m_objMm1Protocol = CoMmsProtocolMm1::Create ();
m_objMmsMessage = CoMmsMessage::Create ();
m_objMmsSlide = CoMmsSlide::Create ();
Step 5: Send MMS messages
You can now send MMS messages.
The following code shows how to send an MMS message using a GSM/GPRS modem:
//---------------------------------------------------------------------------
#include <vcl.h>
#include <comutil.h>
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
m_objMm1Protocol = CoMmsProtocolMm1::Create ();
m_objMmsMessage = CoMmsMessage::Create ();
m_objMmsSlide = CoMmsSlide::Create ();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormCreate(TObject *Sender)
{
for (int i = 0 ; i < m_objMm1Protocol->GetDeviceCount() ; i++ )
{
ComboDevice->Items->Add ( m_objMm1Protocol->GetDevice(i) );
}
SetDefaultLogfile ();
}
//---------------------------------------------------------------------------
void TForm1::SetDefaultLogfile()
{
CHAR szTemp [ MAX_PATH + 1 ];
GetTempPath ( MAX_PATH, szTemp );
strcat ( szTemp, "MM1.log" );
EditLogfile->Text = szTemp;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::ButtonViewClick(TObject *Sender)
{
if ( EditLogfile->Text.Length() )
{
ShellExecute ( NULL, _T("open"), EditLogfile->Text.c_str(), NULL, NULL, SW_SHOWDEFAULT );
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::ButtonProviderLoadConfigClick(TObject *Sender)
{
OpenDialog->DefaultExt = ".mm1";
OpenDialog->Filter = "MMS Connection Files|*.mm1";
if ( OpenDialog->Execute() == TRUE )
{
m_objMm1Protocol->set_LogFile( WideString ( EditLogfile->Text ) );
m_objMm1Protocol->ProviderProviderLoadConfig ( WideString ( OpenDialog->FileName ) );
if ( GetResult () == 0 )
{
EditAPN->Text = m_objMm1Protocol->ProviderAPN;
EditAccount->Text = m_objMm1Protocol->ProviderAPNAccount;
EditPassword->Text = m_objMm1Protocol->ProviderAPNPassword;
EditGateway->Text = m_objMm1Protocol->ProviderWAPGateway;
EditServer->Text = m_objMm1Protocol->ProviderMMSC;
}
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::ButtonSaveConfigClick(TObject *Sender)
{
SaveDialog->DefaultExt = ".mm1";
SaveDialog->Filter = "MMS Connection Files|*.mm1";
if ( SaveDialog->Execute () == TRUE )
{
m_objMm1Protocol->set_ProviderAPN ( WideString ( EditAPN->Text ) );
m_objMm1Protocol->set_ProviderAPNAccount ( WideString ( EditAccount->Text ) );
m_objMm1Protocol->set_ProviderAPNPassword ( WideString ( EditAccount->Text ) );
m_objMm1Protocol->set_ProviderWAPGateway ( WideString ( EditGateway->Text ) );
m_objMm1Protocol->set_ProviderMMSC ( WideString ( EditServer->Text ) );
m_objMm1Protocol->set_LogFile ( WideString ( EditLogfile->Text ) );
m_objMm1Protocol->ProviderSaveConfig ( WideString ( SaveDialog->FileName ) );
GetResult ();
}
}
//---------------------------------------------------------------------------
long TForm1::GetResult()
{
long lResult = m_objMm1Protocol->LastError;
EditResponse->Text = m_objMm1Protocol->ProviderResponse;
EditResult->Text = "ERROR " + IntToStr ( lResult ) + " : " + m_objMm1Protocol->GetErrorDescription( lResult );
return lResult;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::ButtonBrowseClick(TObject *Sender)
{
OpenDialog->DefaultExt = ".jpg";
OpenDialog->Filter = "Image Files|*.jpg";
if ( OpenDialog->Execute() == TRUE )
{
EditImage->Text = OpenDialog->FileName;
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::ButtonSendClick(TObject *Sender)
{
ButtonSend->Enabled = FALSE;
Cursor = crHourGlass;
// Set Connection Properties
m_objMm1Protocol->Clear();
m_objMm1Protocol->set_ProviderAPN ( WideString ( EditAPN->Text ) );
m_objMm1Protocol->set_ProviderAPNAccount ( WideString ( EditAccount->Text ) );
m_objMm1Protocol->set_ProviderAPNPassword ( WideString ( EditAccount->Text ) );
m_objMm1Protocol->set_ProviderWAPGateway ( WideString ( EditGateway->Text ) );
m_objMm1Protocol->set_ProviderMMSC ( WideString ( EditServer->Text ) );
m_objMm1Protocol->set_LogFile ( WideString ( EditLogfile->Text ) );
// Set Message Properties
m_objMmsMessage->Clear ();
m_objMmsMessage->AddRecipient( WideString ( EditTo->Text ) );
m_objMmsMessage->set_Subject ( WideString ( EditSubject->Text ) );
// Create First Slide
m_objMmsSlide->Clear();
m_objMmsSlide->AddText( WideString ( EditBody->Text ) );
m_objMmsSlide->AddAttachment( WideString (EditImage->Text ), NULL );
// Add The Slide
Variant vtVarSlide ( ( IDispatch* ) m_objMmsSlide );
m_objMmsMessage->AddSlide( ( VARIANT * ) vtVarSlide ) ;
// Send The Message
m_objMm1Protocol->Connect();
if ( GetResult () == 0L )
{
Variant vtVarMessage ( ( IDispatch* ) m_objMmsMessage );
m_objMm1Protocol->Send ( ( VARIANT * ) vtVarMessage );
GetResult ();
m_objMm1Protocol->Disconnect ();
}
ButtonSend->Enabled = True;
Cursor =crDefault;
}
//---------------------------------------------------------------------------
There are many working samples included with the product.
You can also find them on the ActiveXperts FTP site: ftp.activexperts-labs.com/samples/XmsToolkit.
NOTE: Demo Projects are created with Borland C++ Builder 6
The MMS Toolkit project ships with a set of samples for Borland C++ Builder.
The projects are created with Borland C++ Builder 6.
Users with a later version of Borland C++ Builder 6 can open such a project. The Borland Conversion Wizard will guide you through the process of converting the project to the version used.
The ActiveXperts SMS and MMS Toolkit is a SMS development component (SDK). This control can be used by any Windows development platform,
including Visual Basic .NET, Visual CSharp .NET,
ASP .NET (VB,CS),
ASP,
Visual Basic,
Visual Basic for Applications (VBA),
Visual Studio/Visual C++,
Borland Delphi and
C++ Builder,
PHP,
ColdFusion,
HTML,
VBScript and any other ActiveX/COM compliant platform. The SMS and MMS Toolkit is an ActiveXperts Software B.V. Product.
|