Click here to Skip to main content
15,892,537 members
Articles / Desktop Programming / MFC

An SMPPLIB with COM Support

Rate me:
Please Sign up or sign in to vote.
4.94/5 (25 votes)
27 Oct 20039 min read 333.1K   5.5K   87  
It is an SMPP implementation of v3.3 and v3.4 ( partial support). You can use it to connect to SMSC and send/receive SMS.
#pragma once

#define DEFAULT_PORT	5000

#define SMPP_VERSION_33			0x33
#define SMPP_VERSION_34			0x34
#define SMPP_INTERFACE_VERSION	0x34

#ifdef SMPPLIB_EXPORTING
   #define SMPPLIB_DECLSPEC    __declspec(dllexport)
#else
   #define SMPPLIB_DECLSPEC    __declspec(dllimport)
#endif


typedef unsigned short  ushort;
typedef unsigned int    uint;
typedef unsigned char	uchar;
typedef char	int8;				/* Signed integer >= 8	bits */
typedef short	int16;				/* Signed integer >= 16 bits */
typedef unsigned char	uint8;		/* Short for unsigned integer >= 8  bits */
typedef unsigned short	uint16;		/* Short for unsigned integer >= 16 bits */
typedef int		int32;
typedef unsigned int	uint32;		/* Short for unsigned integer >= 32 bits */
typedef unsigned long ulong;
typedef unsigned hyper ulonglong;



//Starting here, for Big Endian defition
#define storeInt(T, A) {	\
	*((T)+3) =	(uchar) ((A));	\
	*((T)+2) = (uchar) (((A) >> 8));	\
	*((T)+1) = (uchar) (((A) >> 16));	\
	*(T) = (uchar) (((A) >> 24)); }

#define storeInt2(T, A) {	\
	*((T)+1) = (uchar) (((A)));	\
	*(T) = (uchar) (((A) >> 8)); }

#define readInt(A)	((int) (	\
				    (((int) ((uchar) (A)[0])) << 24) +\
				    (((uint32) ((uchar) (A)[1])) << 16) +\
				    (((uint32) ((uchar) (A)[2])) << 8) +\
					((uchar) (A)[3])))

#define readInt2(A)	((int) (	\
				    (((int) ((uchar) (A)[0])) << 8) +\
					((uchar) (A)[1])))

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
Hong Kong Hong Kong
I'm a guy situated in Hong Kong with some knowledges in Java, VC++, C#, database, client-server, distributed, and mutithreaded computing and so on. I've been working in various companies as engineer, consultant, programmer.

Lately I was mainly working in banking & financial industries. Personally, I'm working on a trading application on my own now.

Comments and Discussions