Click here to Skip to main content
15,925,181 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: What am I doing wrong? Pin
Stuart Dootson4-Jul-09 4:25
professionalStuart Dootson4-Jul-09 4:25 
GeneralRe: What am I doing wrong? Pin
FISH7864-Jul-09 4:35
FISH7864-Jul-09 4:35 
GeneralRe: What am I doing wrong? Pin
Stuart Dootson4-Jul-09 4:48
professionalStuart Dootson4-Jul-09 4:48 
GeneralRe: What am I doing wrong? Pin
FISH7864-Jul-09 4:57
FISH7864-Jul-09 4:57 
GeneralRe: What am I doing wrong? Pin
Stuart Dootson4-Jul-09 5:05
professionalStuart Dootson4-Jul-09 5:05 
GeneralRe: What am I doing wrong? Pin
molesworth4-Jul-09 4:49
molesworth4-Jul-09 4:49 
GeneralRe: What am I doing wrong? Pin
FISH7864-Jul-09 4:58
FISH7864-Jul-09 4:58 
GeneralRe: What am I doing wrong? Pin
molesworth4-Jul-09 5:05
molesworth4-Jul-09 5:05 
GeneralRe: What am I doing wrong? Pin
FISH7864-Jul-09 5:06
FISH7864-Jul-09 5:06 
GeneralRe: What am I doing wrong? Pin
Stuart Dootson4-Jul-09 5:15
professionalStuart Dootson4-Jul-09 5:15 
GeneralRe: What am I doing wrong? Pin
FISH7864-Jul-09 5:16
FISH7864-Jul-09 5:16 
GeneralRe: What am I doing wrong? Pin
Stuart Dootson4-Jul-09 5:21
professionalStuart Dootson4-Jul-09 5:21 
GeneralRe: What am I doing wrong? Pin
FISH7864-Jul-09 12:33
FISH7864-Jul-09 12:33 
GeneralRe: What am I doing wrong? Pin
Stuart Dootson4-Jul-09 12:36
professionalStuart Dootson4-Jul-09 12:36 
GeneralRe: What am I doing wrong? Pin
FISH7864-Jul-09 12:43
FISH7864-Jul-09 12:43 
GeneralRe: What am I doing wrong? Pin
Stuart Dootson4-Jul-09 12:53
professionalStuart Dootson4-Jul-09 12:53 
GeneralRe: What am I doing wrong? Pin
FISH7864-Jul-09 13:01
FISH7864-Jul-09 13:01 
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.

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.