SMS question

User avatar
Ross_ValuSoft
Posts: 87
Joined: Thu Dec 18, 2008 11:27 am
Location: Melbourne, Australia

Re: SMS question

Post by Ross_ValuSoft »

Thanks José,

My C:\FWPPC\Lib does not have the \ARM subfolder. It has two libs only (Fivece.lib and fivecec.lib)

Where else?

Thanks,

Ross
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Re: SMS question

Post by Otto »

Hello Ross,
I have sms.lib in c:\vce\lib\arm\.

Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org

********************************************************************
User avatar
Ross_ValuSoft
Posts: 87
Joined: Thu Dec 18, 2008 11:27 am
Location: Melbourne, Australia

Re: SMS question

Post by Ross_ValuSoft »

:oops: Banging head on desk ...

yes of course ... so do I :lol:

Thanks to you both.

Cheers,

Ross
User avatar
jlcapel
Posts: 229
Joined: Wed Oct 12, 2005 5:32 pm
Location: Valencia - España
Contact:

Re: SMS question

Post by jlcapel »

Hi,

Someone have tested it ??

Please tell me how it was...

Regards,
José luis Capel
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Re: SMS question

Post by Otto »

Hello José,
I tried to compile the sms.prg but I must miss something.
Do you have an idea?
Thanks in advance
Otto

Lines 1915, Functions/Procedures 1
Generating C source output to 'sms.c'... Done.
Microsoft (R) C/C++ Optimizing Compiler Version 12.20.9615 for ARM
Copyright (C) Microsoft Corp 1984-2002. All rights reserved.

sms.c
c:\fwppc\include\sms.h(241) : error C2061: syntax error : identifier 'SMS_ADDRESS_TYPE'
c:\fwppc\include\sms.h(243) : error C2059: syntax error : '}'
c:\fwppc\include\sms.h(249) : error C2061: syntax error : identifier 'SMS_ADDRESS'
c:\fwppc\include\sms.h(252) : error C2059: syntax error : '}'
c:\fwppc\include\sms.h(281) : error C2061: syntax error : identifier 'PROVIDER_SPECIFIC_MESSAGE_CLASS'
c:\fwppc\include\sms.h(282) : error C2061: syntax error : identifier 'psReplaceOption'
c:\fwppc\include\sms.h(282) : error C2059: syntax error : ';'
c:\fwppc\include\sms.h(287) : error C2059: syntax error : '}'
c:\fwppc\include\sms.h(309) : error C2061: syntax error : identifier 'PROVIDER_SPECIFIC_MESSAGE_CLASS'
c:\fwppc\include\sms.h(310) : error C2061: syntax error : identifier 'psReplaceOption'
c:\fwppc\include\sms.h(310) : error C2059: syntax error : ';'
c:\fwppc\include\sms.h(311) : error C2061: syntax error : identifier 'npsMsgWaitingType'
c:\fwppc\include\sms.h(311) : error C2059: syntax error : ';'
c:\fwppc\include\sms.h(313) : error C2061: syntax error : identifier 'npsIndicatorType'
c:\fwppc\include\sms.h(313) : error C2059: syntax error : ';'
c:\fwppc\include\sms.h(314) : error C2059: syntax error : '}'
c:\fwppc\include\sms.h(324) : error C2061: syntax error : identifier 'WDP_PROVIDER_SPECIFIC_PORT_ADDRESSING'
c:\fwppc\include\sms.h(327) : error C2059: syntax error : '}'
c:\fwppc\include\sms.h(340) : error C2061: syntax error : identifier 'WCMP_PROVIDER_SPECIFIC_MESSAGE_TYPE'
c:\fwppc\include\sms.h(344) : error C2061: syntax error : identifier 'smsaAddress'
c:\fwppc\include\sms.h(344) : error C2059: syntax error : ';'
c:\fwppc\include\sms.h(345) : error C2059: syntax error : '}'
c:\fwppc\include\sms.h(351) : error C2061: syntax error : identifier 'SMS_STATUS_INFORMATION'
c:\fwppc\include\sms.h(352) : error C2059: syntax error : '}'
c:\fwppc\include\sms.h(367) : error C2061: syntax error : identifier 'BROADCAST_PROVIDER_SPECIFIC_GEOGRAPHICAL_SCOPE'
c:\fwppc\include\sms.h(369) : error C2059: syntax error : '}'
c:\fwppc\include\sms.h(419) : error C2143: syntax error : missing ')' before '*'
c:\fwppc\include\sms.h(419) : error C2143: syntax error : missing '{' before '*'
c:\fwppc\include\sms.h(419) : error C2059: syntax error : 'type'
c:\fwppc\include\sms.h(429) : error C2059: syntax error : ')'
c:\fwppc\include\sms.h(440) : error C2143: syntax error : missing ')' before '*'
c:\fwppc\include\sms.h(440) : error C2081: 'SMS_ADDRESS' : name in formal parameter list illegal
c:\fwppc\include\sms.h(440) : error C2143: syntax error : missing '{' before '*'
c:\fwppc\include\sms.h(440) : error C2059: syntax error : 'type'
c:\fwppc\include\sms.h(448) : error C2059: syntax error : ')'
c:\fwppc\include\sms.h(454) : error C2143: syntax error : missing ')' before '*'
c:\fwppc\include\sms.h(454) : error C2081: 'SMS_STATUS_INFORMATION' : name in formal parameter list illegal
c:\fwppc\include\sms.h(454) : error C2143: syntax error : missing '{' before '*'
c:\fwppc\include\sms.h(454) : error C2059: syntax error : 'type'
c:\fwppc\include\sms.h(456) : error C2059: syntax error : ')'
c:\fwppc\include\sms.h(460) : error C2143: syntax error : missing ')' before '*'
c:\fwppc\include\sms.h(460) : error C2143: syntax error : missing '{' before '*'
c:\fwppc\include\sms.h(460) : error C2059: syntax error : 'type'
c:\fwppc\include\sms.h(461) : error C2059: syntax error : ')'
c:\fwppc\include\sms.h(465) : error C2143: syntax error : missing ')' before '*'
c:\fwppc\include\sms.h(465) :
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org

********************************************************************
User avatar
jlcapel
Posts: 229
Joined: Wed Oct 12, 2005 5:32 pm
Location: Valencia - España
Contact:

Re: SMS question

Post by jlcapel »

Otto,

:oops: I forgot to tell you (everybody) that I had to 'correct' manually sms.h

Seemed that sms.h (for evc version used by fwppc) have several compiling errors as you've showed. Tomorrow I'll show all the corrections (4 or 5 more or less).

I think that we should update to a new and modern compiler... for example msvc 2005/2008 or even pelles c or mingw. All of these compilers are perfectly supported by Harbour for wince.

So... Should we move to a fresh and modern compiler?
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: SMS question

Post by Antonio Linares »

Jose Luis,

> Should we move to a fresh and modern compiler?

If we find a Microsoft one which it is free and fully available, why not ? :-)
Suggestions are welcome

Anyhow, the one used with FWPPC works really fine.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
jlcapel
Posts: 229
Joined: Wed Oct 12, 2005 5:32 pm
Location: Valencia - España
Contact:

Re: SMS question

Post by jlcapel »

Antonio,
If we find a Microsoft one which it is free and fully available, why not ? :-)
Suggestions are welcome
Well, AFAIK express versions of MSVC can't compile to ARM :-(

So there is no free choice at this moment...
Anyhow, the one used with FWPPC works really fine.
I know!! It works fine but we want it better!!! :-)
User avatar
jlcapel
Posts: 229
Joined: Wed Oct 12, 2005 5:32 pm
Location: Valencia - España
Contact:

Re: SMS question

Post by jlcapel »

Hi all,

Here you are corrected sms.h

Regards,
José Luis CApel

Code: Select all

//////////////////////////////////////////////////////////////////////////
// Copyright (c) Microsoft Corporation. All rights reserved.            //
//////////////////////////////////////////////////////////////////////////


#ifndef _SMS_H_
#define _SMS_H_


#include <windows.h>


#ifdef __cplusplus
extern "C" {
#endif


//
// Errors
//
#define FACILITY_SMS                           0x200

// Specific registration errors (for SmsSetMessageNotification, SmsClearMessageNotification)
#define SMS_E_INVALIDPROTOCOL                  MAKE_HRESULT(SEVERITY_ERROR,   FACILITY_SMS, 0x0001)
#define SMS_E_REGISTRATIONEXISTS               MAKE_HRESULT(SEVERITY_ERROR,   FACILITY_SMS, 0x0002)
#define SMS_S_NOSUCHREGISTRATION               MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_SMS, 0x0003)

// Specific messaging errors (for SmsOpen, SmsSendMessage, SmsGetSMSC, etc.)
#define SMS_E_TOOMUCHDATA                      MAKE_HRESULT(SEVERITY_ERROR,   FACILITY_SMS, 0x0100)
#define SMS_E_INVALIDDATA                      MAKE_HRESULT(SEVERITY_ERROR,   FACILITY_SMS, 0x0101)
#define SMS_E_BUFFERTOOSMALL                   MAKE_HRESULT(SEVERITY_ERROR,   FACILITY_SMS, 0x0102)
#define SMS_E_PROVIDERSPECIFICBUFFERWRONGSIZE  MAKE_HRESULT(SEVERITY_ERROR,   FACILITY_SMS, 0x0103)
#define SMS_E_TIMEUNAVAILABLE                  MAKE_HRESULT(SEVERITY_ERROR,   FACILITY_SMS, 0x0104)
#define SMS_E_RECEIVEHANDLEALREADYOPEN         MAKE_HRESULT(SEVERITY_ERROR,   FACILITY_SMS, 0x0105)
#define SMS_E_DESTINATIONOUTOFSVC              MAKE_HRESULT(SEVERITY_ERROR,   FACILITY_SMS, 0x0106)
#define SMS_E_INVALIDADDRESS                   MAKE_HRESULT(SEVERITY_ERROR,   FACILITY_SMS, 0x0107)
#define SMS_E_MSGBARREDBYOPERATOR              MAKE_HRESULT(SEVERITY_ERROR,   FACILITY_SMS, 0x0108)
#define SMS_E_MSGCALLBARRED                    MAKE_HRESULT(SEVERITY_ERROR,   FACILITY_SMS, 0x0109)
#define SMS_E_NOSCSUBSCRIPTION                 MAKE_HRESULT(SEVERITY_ERROR,   FACILITY_SMS, 0x010a)
#define SMS_E_SCBUSY                           MAKE_HRESULT(SEVERITY_ERROR,   FACILITY_SMS, 0x010b)
#define SMS_E_SVCNOTSUBSCRIBED                 MAKE_HRESULT(SEVERITY_ERROR,   FACILITY_SMS, 0x010c)
#define SMS_E_UNASSIGNEDNUMBER                 MAKE_HRESULT(SEVERITY_ERROR,   FACILITY_SMS, 0x010d)
#define SMS_E_UNKNOWNSCADDRESS                 MAKE_HRESULT(SEVERITY_ERROR,   FACILITY_SMS, 0x010e)
#define SMS_E_UNIDENTIFIEDSUBCRIBER            MAKE_HRESULT(SEVERITY_ERROR,   FACILITY_SMS, 0x010f)

// General SMS messaging errors
#define SMS_E_MISC                             MAKE_HRESULT(SEVERITY_ERROR,   FACILITY_SMS, 0x0200)
#define SMS_E_PASSWORD                         MAKE_HRESULT(SEVERITY_ERROR,   FACILITY_SMS, 0x0201)
#define SMS_E_SIM                              MAKE_HRESULT(SEVERITY_ERROR,   FACILITY_SMS, 0x0202)
#define SMS_E_NETWORKACCESS                    MAKE_HRESULT(SEVERITY_ERROR,   FACILITY_SMS, 0x0203)
#define SMS_E_NETWORK                          MAKE_HRESULT(SEVERITY_ERROR,   FACILITY_SMS, 0x0204)
#define SMS_E_MOBILE                           MAKE_HRESULT(SEVERITY_ERROR,   FACILITY_SMS, 0x0205)
#define SMS_E_NETWORKUNSUPPORTED               MAKE_HRESULT(SEVERITY_ERROR,   FACILITY_SMS, 0x0206)
#define SMS_E_MOBILEUNSUPPORTED                MAKE_HRESULT(SEVERITY_ERROR,   FACILITY_SMS, 0x0207)
#define SMS_E_BADPARAM                         MAKE_HRESULT(SEVERITY_ERROR,   FACILITY_SMS, 0x0208)
#define SMS_E_STORAGE                          MAKE_HRESULT(SEVERITY_ERROR,   FACILITY_SMS, 0x0209)
#define SMS_E_SMSC                             MAKE_HRESULT(SEVERITY_ERROR,   FACILITY_SMS, 0x020a)
#define SMS_E_DESTINATION                      MAKE_HRESULT(SEVERITY_ERROR,   FACILITY_SMS, 0x020b)
#define SMS_E_DESTINATIONUNSUPPORTED           MAKE_HRESULT(SEVERITY_ERROR,   FACILITY_SMS, 0x020c)
#define SMS_E_RADIOUNAVAILABLE                 MAKE_HRESULT(SEVERITY_ERROR,   FACILITY_SMS, 0x020d)


//
// Constants
//
#define SMS_DATAGRAM_SIZE            (140)
#define SMS_BROADCAST_DATAGRAM_SIZE  (82)
#define SMS_MAX_APPNAME_LENGTH       (MAX_PATH)
#define SMS_MAX_PARAMS_LENGTH        (MAX_PATH)
#define SMS_MAX_PROTOCOLNAME_LENGTH  (MAX_PATH)
#define SMS_MAX_MESSAGEUID_SIZE      (1024)
#define SMS_MAX_ADDRESS_LENGTH       (256)
#define SMS_MAX_SUBADDRESS_SIZE      (256)
// dwMessageModes for SmsOpen
#define SMS_MODE_RECEIVE              (0x00000001)
#define SMS_MODE_SEND                 (0x00000002)
// dwOptions for SmsSendMessage
#define SMS_OPTION_DELIVERY_NONE      (0x00000000)
#define SMS_OPTION_DELIVERY_NO_RETRY  (0x00000001)
// dwMessageOptions for TEXT_PROVIDER_SPECIFIC_DATA
#define PS_MESSAGE_OPTION_NONE          (0x00000000)
#define PS_MESSAGE_OPTION_REPLYPATH     (0x00000001)
#define PS_MESSAGE_OPTION_STATUSREPORT  (0x00000002)
#define PS_MESSAGE_OPTION_DISCARD       (0x00000004)
// dwMessageStatus0 and dwMessageStatus1 for SmsGetMessageStatus and the SMS status-message provider (SMS_MSGTYPE_STATUS)
// Message status is unknown iff dwMessageStatus0 and dwMessageStatus1 are both set to MESSAGE_STATUS_UNKNOWN
#define MESSAGE_STATUS_UNKNOWN                  (0x00000000)
// Valid bits for dwMessageStatus0
#define MESSAGE_STATUS_0_RECEIVEDBYSME            (0x00000001)
#define MESSAGE_STATUS_0_FORWARDEDTOSME           (0x00000002)
#define MESSAGE_STATUS_0_REPLACEDBYSC             (0x00000004)
#define MESSAGE_STATUS_0_CONGESTION_TRYING        (0x00000008)
#define MESSAGE_STATUS_0_SMEBUSY_TRYING           (0x00000010)
#define MESSAGE_STATUS_0_SMENOTRESPONDING_TRYING  (0x00000020)
#define MESSAGE_STATUS_0_SVCREJECTED_TRYING       (0x00000040)
#define MESSAGE_STATUS_0_QUALITYUNAVAIL_TRYING    (0x00000080)
#define MESSAGE_STATUS_0_SMEERROR_TRYING          (0x00000100)
#define MESSAGE_STATUS_0_CONGESTION               (0x00000200)
#define MESSAGE_STATUS_0_SMEBUSY                  (0x00000400)
#define MESSAGE_STATUS_0_SMENOTRESPONDING         (0x00000800)
#define MESSAGE_STATUS_0_SVCREJECTED              (0x00001000)
#define MESSAGE_STATUS_0_QUALITYUNAVAIL_TEMP      (0x00002000)
#define MESSAGE_STATUS_0_SMEERROR                 (0x00004000)
#define MESSAGE_STATUS_0_REMOTEPROCERROR          (0x00008000)
#define MESSAGE_STATUS_0_INCOMPATIBLEDEST         (0x00010000)
#define MESSAGE_STATUS_0_CONNECTIONREJECTED       (0x00020000)
#define MESSAGE_STATUS_0_NOTOBTAINABLE            (0x00040000)
#define MESSAGE_STATUS_0_NOINTERNETWORKING        (0x00080000)
#define MESSAGE_STATUS_0_VPEXPIRED                (0x00100000)
#define MESSAGE_STATUS_0_DELETEDBYORIGSME         (0x00200000)
#define MESSAGE_STATUS_0_DELETEDBYSC              (0x00400000)
#define MESSAGE_STATUS_0_NOLONGEREXISTS           (0x00800000)
#define MESSAGE_STATUS_0_QUALITYUNAVAIL           (0x01000000)
#define MESSAGE_STATUS_0_RESERVED_COMPLETED       (0x02000000)
#define MESSAGE_STATUS_0_RESERVED_TRYING          (0x04000000)
#define MESSAGE_STATUS_0_RESERVED_ERROR           (0x08000000)
#define MESSAGE_STATUS_0_RESERVED_TMPERROR        (0x10000000)
#define MESSAGE_STATUS_0_SCSPECIFIC_COMPLETED     (0x20000000)
#define MESSAGE_STATUS_0_SCSPECIFIC_TRYING        (0x40000000)
#define MESSAGE_STATUS_0_SCSPECIFIC_ERROR         (0x80000000)
// Valid bits for dwMessageStatus1
#define MESSAGE_STATUS_1_SCSPECIFIC_TMPERROR      (0x00000001)
// Language identifiers for SMS_BROADCAST_RANGES.dwBroadcastMsgLangs
#define SMS_DCSLANG_UNKNOWN                       (0x00000001)
#define SMS_DCSLANG_GERMAN                        (0x00000002)
#define SMS_DCSLANG_ENGLISH                       (0x00000004)
#define SMS_DCSLANG_ITALIAN                       (0x00000008)
#define SMS_DCSLANG_FRENCH                        (0x00000010)
#define SMS_DCSLANG_SPANISH                       (0x00000020)
#define SMS_DCSLANG_DUTCH                         (0x00000040)
#define SMS_DCSLANG_SWEDISH                       (0x00000080)
#define SMS_DCSLANG_DANISH                        (0x00000100)
#define SMS_DCSLANG_PORTUGUESE                    (0x00000200)
#define SMS_DCSLANG_FINNISH                       (0x00000400)
#define SMS_DCSLANG_NORWEGIAN                     (0x00000800)
#define SMS_DCSLANG_GREEK                         (0x00001000)
#define SMS_DCSLANG_TURKISH                       (0x00002000)
#define SMS_DCSLANG_HUNGARIAN                     (0x00004000)
#define SMS_DCSLANG_POLISH                        (0x00008000)
#define SMS_DCSLANG_CZECH                         (0x00010000)
#define SMS_DCSLANG_ALL                           (0x0001ffff)
// Valid flags for SMS_BROADCAST_RANGES.dwParams
#define SMS_PARAM_SBR_BROADCASTMSGIDS             (0x00000001)
#define SMS_PARAM_SBR_BROADCASTMSGLANGS           (0x00000002)
#define SMS_PARAM_SBR_ACCEPTIDS                   (0x00000004)
//Valid values for ProtocolID
#define SMS_MSGPROTOCOL_UNKNOWN                     (0x00000000)      
#define SMS_MSGPROTOCOL_SMETOSME                    (0x00000001)      
#define SMS_MSGPROTOCOL_IMPLICIT                    (0x00000002)      
#define SMS_MSGPROTOCOL_TELEX                       (0x00000003)      
#define SMS_MSGPROTOCOL_TELEFAX_GROUP3              (0x00000004)      
#define SMS_MSGPROTOCOL_TELEFAX_GROUP4              (0x00000005)      
#define SMS_MSGPROTOCOL_VOICEPHONE                  (0x00000006)      
#define SMS_MSGPROTOCOL_ERMES                       (0x00000007)      
#define SMS_MSGPROTOCOL_PAGING                      (0x00000008)      
#define SMS_MSGPROTOCOL_VIDEOTEX                    (0x00000009)      
#define SMS_MSGPROTOCOL_TELETEX                     (0x0000000a)      
#define SMS_MSGPROTOCOL_TELETEX_PSPDN               (0x0000000b)      
#define SMS_MSGPROTOCOL_TELETEX_CSPDN               (0x0000000c)      
#define SMS_MSGPROTOCOL_TELETEX_PSTN                (0x0000000d)      
#define SMS_MSGPROTOCOL_TELETEX_ISDN                (0x0000000e)      
#define SMS_MSGPROTOCOL_UCI                         (0x0000000f)      
#define SMS_MSGPROTOCOL_MSGHANDLING                 (0x00000010)      
#define SMS_MSGPROTOCOL_X400                        (0x00000011)      
#define SMS_MSGPROTOCOL_EMAIL                       (0x00000012)      
#define SMS_MSGPROTOCOL_SCSPECIFIC1             (0x00000013)     
#define SMS_MSGPROTOCOL_SCSPECIFIC2             (0x00000014)     
#define SMS_MSGPROTOCOL_SCSPECIFIC3             (0x00000015)     
#define SMS_MSGPROTOCOL_SCSPECIFIC4             (0x00000016)     
#define SMS_MSGPROTOCOL_SCSPECIFIC5             (0x00000017)     
#define SMS_MSGPROTOCOL_SCSPECIFIC6             (0x00000018)     
#define SMS_MSGPROTOCOL_SCSPECIFIC7             (0x00000019)     
#define SMS_MSGPROTOCOL_GSMSTATION                  (0x0000001a)      
#define SMS_MSGPROTOCOL_SM_TYPE0                    (0x0000001b)      
#define SMS_MSGPROTOCOL_RSM_TYPE1                   (0x0000001c)      
#define SMS_MSGPROTOCOL_RSM_TYPE2                   (0x0000001d)      
#define SMS_MSGPROTOCOL_RSM_TYPE3                   (0x0000001e)      
#define SMS_MSGPROTOCOL_RSM_TYPE4                   (0x0000001f)      
#define SMS_MSGPROTOCOL_RSM_TYPE5                   (0x00000020)      
#define SMS_MSGPROTOCOL_RSM_TYPE6                   (0x00000021)      
#define SMS_MSGPROTOCOL_RSM_TYPE7                   (0x00000022)      
#define SMS_MSGPROTOCOL_RETURNCALL                  (0x00000023)      
#define SMS_MSGPROTOCOL_ME_DOWNLOAD                 (0x00000024)      
#define SMS_MSGPROTOCOL_DEPERSONALIZATION           (0x00000025)      
#define SMS_MSGPROTOCOL_SIM_DOWNLOAD                (0x00000026)      


//
// Enumerations
//
enum SMS_ADDRESS_TYPE {
    SMSAT_UNKNOWN=0,
    SMSAT_INTERNATIONAL,
    SMSAT_NATIONAL,
    SMSAT_NETWORKSPECIFIC,
    SMSAT_SUBSCRIBER,
    SMSAT_ALPHANUMERIC,
    SMSAT_ABBREVIATED
};
enum SMS_DATA_ENCODING {
    SMSDE_OPTIMAL=0,
    SMSDE_GSM,
    SMSDE_UCS2,
};
enum PROVIDER_SPECIFIC_MESSAGE_CLASS {
    PS_MESSAGE_CLASS0 = 0,
    PS_MESSAGE_CLASS1,
    PS_MESSAGE_CLASS2,
    PS_MESSAGE_CLASS3,
    PS_MESSAGE_CLASSUNSPECIFIED,
};
enum PROVIDER_SPECIFIC_REPLACE_OPTION {
    PSRO_NONE = 0,
    PSRO_REPLACE_TYPE1,
    PSRO_REPLACE_TYPE2,
    PSRO_REPLACE_TYPE3,
    PSRO_REPLACE_TYPE4,
    PSRO_REPLACE_TYPE5,
    PSRO_REPLACE_TYPE6,
    PSRO_REPLACE_TYPE7,
    PSRO_RETURN_CALL,
    PSRO_DEPERSONALIZATION,
};


//
// Types
//
typedef DWORD SMS_HANDLE;
typedef DWORD SMS_MESSAGE_ID;
#define INVALID_MESSAGE_ID ((SMS_MESSAGE_ID)0xffffffff)
// Registration structure used by SmsSetMessageNotification and SmsClearMessageNotification
typedef struct smsregistrationdata_tag {
    DWORD   cbSize;
    TCHAR   tszAppName[SMS_MAX_APPNAME_LENGTH];
    TCHAR   tszParams[SMS_MAX_PARAMS_LENGTH];
    TCHAR   tszProtocolName[SMS_MAX_PROTOCOLNAME_LENGTH];
} SMSREGISTRATIONDATA, *LPSMSREGISTRATIONDATA;
// SMS addressing information
typedef struct sms_address_tag {
    enum SMS_ADDRESS_TYPE smsatAddressType;
    TCHAR ptsAddress[SMS_MAX_ADDRESS_LENGTH];
} SMS_ADDRESS, *LPSMS_ADDRESS;
// SMS status message information
typedef struct sms_status_information_tag {
    SMS_MESSAGE_ID smsmidMessageID;
    DWORD dwMessageStatus0;
    DWORD dwMessageStatus1;
    SMS_ADDRESS smsaRecipientAddress;
    SYSTEMTIME stServiceCenterTimeStamp;  // (UTC time)
    SYSTEMTIME stDischargeTime;  // (UTC time)
} SMS_STATUS_INFORMATION, *LPSMS_STATUS_INFORMATION;
// SMS broadcast message range information
typedef struct sms_range_tag {
    DWORD dwMinimum;
    DWORD dwMaximum;
} SMS_RANGE, *LPSMS_RANGE;
// SMS broadcast message ranges information
// Use #pragma to avoid "warning C4200: nonstandard extension used : zero-sized array in struct/union
#pragma warning(disable:4200)
typedef struct sms_broadcast_ranges_tag {
    DWORD cbSize;
    DWORD dwParams;
    DWORD dwNumRanges;
    DWORD dwBroadcastMsgLangs;
    BOOL bAccept;
    SMS_RANGE smsrBroadcastRanges[];
} SMS_BROADCAST_RANGES, *LPSMS_BROADCAST_RANGES;
#pragma warning(default:4200)


//
// SMS message types (for use with SmsOpen)
//

// Text message type
#define SMS_MSGTYPE_TEXT TEXT("Microsoft Text SMS Protocol")
// Provider-specific data for use with SmsSendMessage and SmsReadMessage
typedef struct text_provider_specific_data_tag {
    DWORD dwMessageOptions;
    enum PROVIDER_SPECIFIC_MESSAGE_CLASS psMessageClass;
    enum PROVIDER_SPECIFIC_REPLACE_OPTION psReplaceOption;
    DWORD dwHeaderDataSize;
    BYTE pbHeaderData[SMS_DATAGRAM_SIZE];   // For concatinated messages, only the header from the first segment is returned.
    BOOL fMessageContainsEMSHeaders;    // at least one segment of this message contains EMS headers.  Only set if EMS handler installed.
    DWORD dwProtocolID; // PID of invoming message, or desired PID of outgoing message.  Applies only to GSM.  Set to SMS_MSGPROTOCOL_UNKNOWN if psReplaceOption is not PSRO_NONE
} TEXT_PROVIDER_SPECIFIC_DATA;

// Notification message type
#define SMS_MSGTYPE_NOTIFICATION TEXT("Microsoft Notification SMS Protocol (Receive Only)")
// Provider-specific data for use with SmsReadMessage
enum NOTIFICATION_PROVIDER_SPECIFIC_MSG_WAITING_TYPE { 
    NOTIFICATIONPSMWT_NONE = 0,
    NOTIFICATIONPSMWT_GENERIC,
    NOTIFICATIONPSMWT_VOICEMAIL,
    NOTIFICATIONPSMWT_FAX,
    NOTIFICATIONPSMWT_EMAIL,
    NOTIFICATIONPSMWT_OTHER,
};
#define NOTIFICATIONPS_NUM_MSG_WAITING_UNKNOWN  (-1)
#define NOTIFICATIONPS_NUM_MSG_WAITING_NONZERO  (-2)
enum NOTIFICATION_PROVIDER_SPECIFIC_INDICATOR_TYPE {
    NOTIFICATIONPSIT_NONE = 0,
    NOTIFICATIONPSIT_LINE1 = 1,
    NOTIFICATIONPSIT_LINE2 = 2,
};
typedef struct notification_provider_specific_data_tag {
    DWORD dwMessageOptions;
    enum PROVIDER_SPECIFIC_MESSAGE_CLASS psMessageClass;
    enum PROVIDER_SPECIFIC_REPLACE_OPTION psReplaceOption;
    enum NOTIFICATION_PROVIDER_SPECIFIC_MSG_WAITING_TYPE npsMsgWaitingType;
    int iNumberOfMessagesWaiting;
    enum NOTIFICATION_PROVIDER_SPECIFIC_INDICATOR_TYPE npsIndicatorType;
} NOTIFICATION_PROVIDER_SPECIFIC_DATA;

// WDP message type
#define SMS_MSGTYPE_WDP TEXT("Microsoft WDP SMS Protocol")
// Provider-specific data for use with SmsSendMessage and SmsReadMessage
enum WDP_PROVIDER_SPECIFIC_PORT_ADDRESSING {
    WDPPSPA_8_BIT_PORT_NUMBERS = 0,
    WDPPSPA_16_BIT_PORT_NUMBERS,
};
typedef struct wdp_provider_specific_data_tag {
    enum WDP_PROVIDER_SPECIFIC_PORT_ADDRESSING wdppsPortAddressing;
    WORD wDestinationPort;
    WORD wOriginatorPort;
} WDP_PROVIDER_SPECIFIC_DATA;

// WCMP message type
#define SMS_MSGTYPE_WCMP TEXT("Microsoft WCMP SMS Protocol")
// Provider-specific data for use with SmsSendMessage and SmsReadMessage
enum WCMP_PROVIDER_SPECIFIC_MESSAGE_TYPE {
    WCMPPSMT_UNSUPPORTED = 0,
    WCMPPSMT_PORT_UNREACHABLE,
    WCMPPSMT_MESSAGE_TOO_BIG,
    WCMPPSMT_ECHO_REQUEST,
    WCMPPSMT_ECHO_REPLY,
};
typedef struct wcmp_provider_specific_data_tag {
    enum WCMP_PROVIDER_SPECIFIC_MESSAGE_TYPE wcmppsMessageType;
    WORD wParam1;
    WORD wParam2;
    WORD wParam3;
    SMS_ADDRESS smsaAddress;
} WCMP_PROVIDER_SPECIFIC_DATA;

// Status message type
#define SMS_MSGTYPE_STATUS TEXT("Microsoft Status Message SMS Protocol (Receive Only)")
// Provider-specific data for use with SmsReadMessage
typedef struct status_provider_specific_data_tag {
    SMS_STATUS_INFORMATION smssiStatusInformation;
} STATUS_PROVIDER_SPECIFIC_DATA;

// Broadcast message type
#define SMS_MSGTYPE_BROADCAST TEXT("Microsoft Broadcast Message SMS Protocol (Receive Only)")
enum BROADCAST_PROVIDER_SPECIFIC_GEOGRAPHICAL_SCOPE {
    BPSGS_UNKNOWN = 0,
    BPSGS_CELL_DISPLAY_IMMEDIATE,
    BPSGS_CELL,
    BPSGS_PLMN,
    BPSGS_LOCATION_AREA,
};
// Provider-specific data for use with SmsReadMessage
typedef struct broadcast_provider_specific_data_tag {
    WORD wMessageID;
    WORD wMessageCode;
    enum BROADCAST_PROVIDER_SPECIFIC_GEOGRAPHICAL_SCOPE bpsgsGeographicalScope;
    WORD wUpdateNumber;
} BROADCAST_PROVIDER_SPECIFIC_DATA;

// Raw message type
#define SMS_MSGTYPE_RAW TEXT("Microsoft Raw SMS Protocol (Receive Only)")
// Provider-specific data for use with SmsReadMessage
typedef struct raw_provider_specific_data_tag {
    DWORD dwHeaderDataSize;
    BYTE pbHeaderData[SMS_DATAGRAM_SIZE];
} RAW_PROVIDER_SPECIFIC_DATA;


//
// APIs for SMS.dll
//
HRESULT SmsSetMessageNotification (
    const SMSREGISTRATIONDATA* psmsrd
);

HRESULT SmsClearMessageNotification (
    const LPCTSTR tszProtocolName
);

// Open the SMS Messaging component for read and/or write access
//
// Each protocol may only have one handle open with SMS_MODE_RECEIVE.
// Additional attempts to get RECEIVE mode on a given protocol will result in
// SMS_E_RECEIVEHANDLEALREADYOPEN.
//
// Currently all protocols have applications whith open RECEIVE handles.  As a
// result, using the SMS API to receive SMS messages is not supported.  Attempts
// to do so may interfere with the proper operation of Inbox, WAP, or other SMS
// applications.
//
// The IMailRuleClient interface in cemapi.h may be used to access received 
// text SMS messages.
HRESULT SmsOpen (
    const LPCTSTR ptsMessageProtocol,
    const DWORD dwMessageModes,
    SMS_HANDLE* const psmshHandle,
    HANDLE* const phMessageAvailableEvent
);

// Close a handle to the SMS messaging component
HRESULT SmsClose (
    const SMS_HANDLE smshHandle
);

// Send an SMS message
HRESULT SmsSendMessage (
    const SMS_HANDLE smshHandle,
    const SMS_ADDRESS* const psmsaSMSCAddress,
    const SMS_ADDRESS* const psmsaDestinationAddress,
    const SYSTEMTIME* const pstValidityPeriod,  // (Values in this structure are expressed relative to the current time)
    const BYTE* const pbData,
    const DWORD dwDataSize,
    const BYTE* const pbProviderSpecificData,
    const DWORD dwProviderSpecificDataSize,
    const enum SMS_DATA_ENCODING smsdeDataEncoding,
    const DWORD dwOptions,
    SMS_MESSAGE_ID* psmsmidMessageID
);

// Determine an upper-bound for the size of the buffer needed by the next call to SmsReadMessage
HRESULT SmsGetMessageSize (
    const SMS_HANDLE smshHandle,
    DWORD* const pdwDataSize
);

// Read an SMS message (the appropriate size of the buffer can be found via a call to SmsGetMessageSize)
HRESULT SmsReadMessage (
    const SMS_HANDLE smshHandle,
    SMS_ADDRESS* const psmsaSMSCAddress,
    SMS_ADDRESS* const psmsaSourceAddress,
    SYSTEMTIME* const pstReceiveTime,  // (UTC time)
    BYTE* const pbBuffer,
    DWORD dwBufferSize,
    BYTE* const pbProviderSpecificBuffer,
    DWORD dwProviderSpecificDataBuffer,
    DWORD* pdwBytesRead
);

// Waits to receive a status-report for an SMS message
HRESULT SmsGetMessageStatus (
    const SMS_HANDLE smshHandle,
    SMS_MESSAGE_ID smsmidMessageID,
    SMS_STATUS_INFORMATION* const psmssiStatusInformation,
    const DWORD dwTimeout
);

// Get the default SMS Service Center address
HRESULT SmsGetSMSC (
    SMS_ADDRESS* const psmsaSMSCAddress
);

// Set the default SMS Service Center address
HRESULT SmsSetSMSC (
    const SMS_ADDRESS* const psmsaSMSCAddress
);

// Get the range of broadcast messages to listen for
HRESULT SmsGetBroadcastMsgRanges (
    SMS_BROADCAST_RANGES* const psmsbrBroadcastRanges
);

// Set the range of broadcast messages to listen for
HRESULT SmsSetBroadcastMsgRanges (
    const SMS_BROADCAST_RANGES* const psmsbrBroadcastRanges
);

// Get the device's phone number for SMS
HRESULT SmsGetPhoneNumber (
    SMS_ADDRESS* const psmsaAddress
);

// Approximate the system time based on the time indicated by the SMSC in the last status-report message
HRESULT SmsGetTime (
    SYSTEMTIME* const ptsCurrentTime,  // (UTC time)
    DWORD* const pdwErrorMargin
);


#ifdef __cplusplus
}
#endif


#endif  // _SMS_H_

 
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: SMS question

Post by Antonio Linares »

Jose Luis,

Thanks! :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
dutch
Posts: 1395
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: SMS question

Post by dutch »

Dear Jose Luis,

I got this error while compile.

Code: Select all

sms.prg(44) : warning C4013: 'HB_TCHAR_CONVTO' undefined; assuming extern returning int
sms.prg(44) : warning C4047: 'initializing' : 'unsigned short *' differs in levels of indirection from 'int '
sms.prg(45) : warning C4047: 'initializing' : 'unsigned short *' differs in levels of indirection from 'int '
sms.prg(53) : warning C4013: 'HB_TCHAR_FREE' undefined; assuming extern returning int
   Creating library sms.lib and object sms.exp
sms.obj : error LNK2019: unresolved external symbol HB_TCHAR_FREE referenced in function HB_FUN_SEND_SMS
sms.obj : error LNK2019: unresolved external symbol HB_TCHAR_CONVTO referenced in function HB_FUN_SEND_SMS
sms.exe : fatal error LNK1120: 2 unresolved externals
 
Thanks&Regards,
Regards,
Dutch

FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
User avatar
jlcapel
Posts: 229
Joined: Wed Oct 12, 2005 5:32 pm
Location: Valencia - España
Contact:

Re: SMS question

Post by jlcapel »

Hi Dutch,

What version of Harbour do you have?

Did you include hbapi.h ?
User avatar
dutch
Posts: 1395
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: SMS question

Post by dutch »

Dear Jose,

I'm sorry, it's old version problem. I use the new version and compile without problem. When I will report after testing.

Thanks&Regards,
Dutch
Regards,
Dutch

FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Re: SMS question

Post by Otto »

Hello José,
thank you so much. All is working. This opens many new possibilities.

Maybe you could help with code to receive SMS messages.
At the moment I use VB6 with messagemaster from DERDACK.
This is my last program waiting to convert to FIVEWIN.

Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org

********************************************************************
User avatar
jlcapel
Posts: 229
Joined: Wed Oct 12, 2005 5:32 pm
Location: Valencia - España
Contact:

Re: SMS question

Post by jlcapel »

Otto,

I'm working on it. Hope in short time I'll finish some classes to manage SIM Api, SMS api, etc...

Regards,
José Luis Capel
Post Reply