REVISION HISTORY
EDITION | ISSUED DATE | REMARK |
---|---|---|
3rd | 18th of July, 2013 | Revised FAQ section |
2nd | 1st of August, 2012 | FAQ section added |
1st | 1st of August, 2009 | Draft release |
COPYRIGHT
© 2012 MOBITEK System Sdn. Bhd. All rights reserved.
No part of this document may be reproduced, distributed, stored in a retrieval system or translated into any language, in any form or by any means, electronic, mechanical, magnetic, optical, photocopying, manual or otherwise, without the prior written permission of MOBITEK System Sdn. Bhd.
TRADEMARK
MOBITEK® is a registered trademark owns by MOBITEK System Sdn. Bhd.
Product names, logos, brands and other trademarks referred in this document are the property of their respective trademark holders and are used only to directly describe the products being provided.
DISCLAIMER
MOBITEK makes no representations or warranties with respect to the contents hereof and specifically disclaims any implied warranties of merchantability or fitness for any particular purpose.
Furthermore, MOBITEK reserves the right to revise this publication and to make changes from time to time in the contents hereof without obligation to notify any person of such revision or changes.
Trademarks and Registered Trademarks Products and product names mentioned in this document may be trademarks or registered trademarks of their respective owners.
ACKNOWLEDGEMENT
We like to extend our appreciation to the following trainees who had contributed to the authoring of this manual:-
- Mr. Alfred Ang Yit Lun, UNIVERSITY PUTRA MALAYSIA
- Mr. Chai Yick Loong, UNIVERSITY PUTRA MALAYSIA
- Ms. Yela, MASA College
SPECIFICATION
API TYPE: ActiveX DLL (Component Object Model) for Windows only
ActiveX File Name: MobitekSMSAPI7.dll
Requirement:
- You must be a software developer and you must posses programming skill and knowledge on using ActiveX component.
- Visual Basic 2008 Express, Visual Studio 2008
SCOPE OF THIS MANUAL
This manual provides a brief guide on using SMS API in Visual Basic 2008.
This manual:-
- does not teach you how to write Visual Basic;
- does not teach yo how to code; and
- does not teach you how to integrate with database or external system.
For further information about the SMS API (methods and properties), please refer to the help file, “SMS API v5 Manual.chm” that is located in the CD.
To obtain a sample code written in Visual Basic 2008, please refer to the CD.
BENEFITS
The benefits for software developer in using MOBITEK® SMS API version 7 are:
- rapid development of a SMS Gateway
- full control of the message flow, business logic and the design of SMS Gateway
- can decide how to handle incoming message – trigger an event, or launch an external application
- can decide where to store the incoming message – in database, in text, or in XML
- can decide who should receive outgoing message, when to send, what the send
- integrate SMS feature with external software application
- able to check credit balance of prepaid account
- able to reload, top-up the prepaid account
SET-UP
Step 1: Ensure GSM modem is properly configured with the correct COM port (refer to the GSM modem installation guide).
Step 2: Install the SMS API (COM-ActiveX), i.e. Run the “setup.exe” from the CD.
Step 3: Open Visual Basic 2008, go to “New Project”, insert the project name and click “OK”.
Step 4: To configure to use the “MobitekSMSAPI7.dll”, go to “Project > Add Reference”.
Step 5: Select “COM” and find “MobitekSMSAPI7”. Click “OK” after that.
Step 6: To confirm the “MobitekSMSAPI7.dll” file is referenced properly, go to “View > Object Browser”.
Step 7: If you see “Interop.MobitekSMSAPI7” in the list, mean the “MobitekSMSAPI7.dll” file was add in successfully.
Step 8: To start write a source code, go to “Project > Add Module > Name”.
Step 9: At the beginning, user have to create object for SMS in file Module1.vb.
“Public SMS As New MobitekSMSAPI7.SMS”
Step 10: To insert the source code, type “SMS.” like below.
When you type it, you will see another box is appear, and you may select from it.
This also mean that, the “MobitekSMSAPI7.dll” file is referenced successfully and the object for SMS is created.
Step 11: You can continue writing your code. And happy coding!
FAQ
Question: When calling the method Modem.Init(), this error appears – “Retrieving the COM class factory for component with CLSID {C7B56BA9-90BC-4B2B-BA02-DF1FCBE506A7} failed due to the following error: 80040154.
Answer: In Visual Studio .Net, modify your project’s platform from “Any CPU” to “x86” in “Project Properties > Build/Platform’s Target. Refer figures below for step-by-step guide.
Question: How to solve the error message — “Type Initialization was unhandled”?
Root Cause | Solution |
---|---|
The COM "MobitekSMSAPI7.dll" is not referenced at all; | To re-reference COM |
The COM "MobitekSMSAPI7.dll" is referenced but was not properly registered during installation; | Re-register the COM. |
In 64 bit Windows OS; the Visual Studio (or VB.net Express) is configured to be build on "Any CPU" platform | Please refer to the screen capture of FAQ No 1 to configure the platform from “Any CPU” to “x86”. |
Step-By-Step Guide on Re-Reference COM |
|
---|---|
Step 1: Project > SMS properties | |
Step 2: Reference > Unspecified reference > Remove | |
Step 3: Project > Add Reference | |
Step 4: COM > MobitekSMSAPI7 > OK |
Step-By-Step Guide on Re-Register the COM
Step 1: Login as Administrator.
Step 2: Find “MobitekSMSAPI7.dll” in “System32” folder.
Step 3: If not found then reinstall.
Step 4: If found then click on Start > Run and enter “regsvr32 mobiteksmsapi7.dll” click “OK” to manually register,