Click here to Skip to main content
15,886,110 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: What am I doing wrong? Pin
Stuart Dootson4-Jul-09 13:06
professionalStuart Dootson4-Jul-09 13:06 
GeneralRe: What am I doing wrong? Pin
FISH7864-Jul-09 13:09
FISH7864-Jul-09 13:09 
GeneralRe: What am I doing wrong? Pin
Stuart Dootson4-Jul-09 13:10
professionalStuart Dootson4-Jul-09 13:10 
GeneralRe: What am I doing wrong? Pin
FISH7864-Jul-09 15:33
FISH7864-Jul-09 15:33 
GeneralRe: What am I doing wrong? Pin
Stuart Dootson4-Jul-09 22:40
professionalStuart Dootson4-Jul-09 22:40 
GeneralRe: What am I doing wrong? Pin
FISH7865-Jul-09 0:56
FISH7865-Jul-09 0:56 
GeneralRe: What am I doing wrong? Pin
Eytukan4-Jul-09 6:16
Eytukan4-Jul-09 6:16 
QuestionSmsSendMessage fails. Pin
Le@rner4-Jul-09 1:30
Le@rner4-Jul-09 1:30 
Hi all ,

i m using SmsSendMessage api for sending sms but its fails.

my code is.

LPCTSTR lpszSMSC, lpszRecipient, lpszMessage;

	SMS_HANDLE smshHandle;
	SMS_ADDRESS smsaSource;
	SMS_ADDRESS smsaDestination;
	TEXT_PROVIDER_SPECIFIC_DATA tpsd;
	SMS_MESSAGE_ID smsmidMessageID;

	HRESULT hr = SmsOpen(SMS_MSGTYPE_TEXT, SMS_MODE_SEND, &smshHandle, NULL);

	if (hr != ERROR_SUCCESS) 
	{ 
	   return hr;  // never fails
	}

	
	// Create the source address
	smsaSource.smsatAddressType = SMSAT_UNKNOWN;
	_tcsncpy(smsaSource.ptsAddress, lpszSMSC, SMS_MAX_ADDRESS_LENGTH);

	// Create the destination address
	smsaDestination.smsatAddressType = SMSAT_UNKNOWN;
	_tcsncpy(smsaDestination.ptsAddress, lpszRecipient, SMS_MAX_ADDRESS_LENGTH);

	// Set up provider specific data
	DWORD sof = sizeof(TEXT_PROVIDER_SPECIFIC_DATA);
	memset(&tpsd, 0, sof);
	tpsd.dwMessageOptions = PS_MESSAGE_OPTION_NONE;
	tpsd.psMessageClass = PS_MESSAGE_CLASS1; // I also tried PS_MESSAGE_CLASS1
	tpsd.psReplaceOption = PSRO_NONE;
	    
	// send the message
	SmsSendMessage (smshHandle,&smsaSource,
			 &smsaDestination,
					NULL,
		  (PBYTE)lpszMessage, // the message
		  _tcslen(lpszMessage) * sizeof(TCHAR), // the message l;ength
			(PBYTE) &tpsd,
							 sof,    // Boling sets this to 12  tired it each way does not change anything
		  SMSDE_OPTIMAL,
	   SMS_OPTION_DELIVERY_NONE,
		 &smsmidMessageID );

SmsClose (smshHandle);please help me for this.


please help me for this.

thanks in advance.

To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.

AnswerRe: SmsSendMessage fails. Pin
«_Superman_»4-Jul-09 2:14
professional«_Superman_»4-Jul-09 2:14 
GeneralRe: SmsSendMessage fails. Pin
Le@rner4-Jul-09 2:16
Le@rner4-Jul-09 2:16 
AnswerRe: SmsSendMessage fails. Pin
Hamid_RT4-Jul-09 3:00
Hamid_RT4-Jul-09 3:00 
GeneralRe: SmsSendMessage fails. Pin
Le@rner4-Jul-09 3:02
Le@rner4-Jul-09 3:02 
QuestionPower configuration settings on Win2K3 and Win2K using "powercfg.exe" Pin
sandy.pune4-Jul-09 1:29
sandy.pune4-Jul-09 1:29 
QuestionAny similar option to PROVIDER_SPECIFIC_MESSAGE_CLASS in CEMAPI. Pin
Le@rner4-Jul-09 1:28
Le@rner4-Jul-09 1:28 
Questionvalues for PR_MESSAGE_CLASS. Pin
Le@rner4-Jul-09 1:27
Le@rner4-Jul-09 1:27 
Questioncrystl32.ocx version 5.2 setselectionformula() displaying E message Pin
Hussain Azhar4-Jul-09 0:02
Hussain Azhar4-Jul-09 0:02 
Questionorder of icons in CListCtrl Pin
popwander9993-Jul-09 22:09
popwander9993-Jul-09 22:09 
AnswerRe: order of icons in CListCtrl Pin
«_Superman_»4-Jul-09 3:00
professional«_Superman_»4-Jul-09 3:00 
GeneralRe: order of icons in CListCtrl Pin
popwander9994-Jul-09 21:48
popwander9994-Jul-09 21:48 
Questiongetting data from non-.txt files properly Pin
UserNameless3-Jul-09 21:25
UserNameless3-Jul-09 21:25 
AnswerRe: getting data from non-.txt files properly Pin
Cedric Moonen3-Jul-09 21:42
Cedric Moonen3-Jul-09 21:42 
GeneralRe: getting data from non-.txt files properly Pin
UserNameless3-Jul-09 21:45
UserNameless3-Jul-09 21:45 
AnswerRe: getting data from non-.txt files properly Pin
Rajesh R Subramanian3-Jul-09 22:50
professionalRajesh R Subramanian3-Jul-09 22:50 
GeneralRe: getting data from non-.txt files properly Pin
UserNameless3-Jul-09 23:30
UserNameless3-Jul-09 23:30 
GeneralRe: getting data from non-.txt files properly Pin
Rajesh R Subramanian4-Jul-09 2:51
professionalRajesh R Subramanian4-Jul-09 2:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.