-
SMS question.
Hi to all,
I am using the code of Kiran -> SmsHandler.
Now, I succeed to send SMS message.
The question is if every time that I send sms I need to Open new MTM???
I mean.. in the source code there is
HandleSessionEventL
case: EMsvServerReady
...
AccessMTM();
SendMsg()
Do I need to Initialize like that :
[CODE]
CSmsHandler* iSmsHandler = CSmsHandler::NewL();
[/CODE]
every time when I send SMS message ?
I am using console application(EXE)
Usage For example:
every time that press '5' key it will send SMS.
Any help ????
-
Re: SMS question.
Well from the code it looks to me that since it is a member variable it is initialized only once during the creation of that object, but since I have not seen the complete code I am not sure if that object is created locally everytime.My understanding says it should be done only once you your application is launched and it should work fine after that.
-
Re: SMS question.
hi,
It should not be a problem you need to declare you iSmsHandler as the memeber variable of the class create it once in the ConstructL of your class, and implement the key capture code as given in this wiki [URL="http://wiki.forum.nokia.com/index.php/Capturing_all_keys_in_Non-GUI_applications"]link[/URL] for the key 5. You should be able to send sms for every key press of 5.
-
Re: SMS question.
Hi,
Thanks for the reply.
I did what you advice to me
I have insert the
[code]
CSmsHandler* iSmsHandler = CSmsHandler::NewL();
[/code]
to the constructor of my class.
But the problem is when I calling the function CreateMsgL()
the my program stak on that line:
[Code]
iSmsMtm->SwitchCurrentEntryL( KMsvDraftEntryId );
[/code]
The error:
[code]
Suspended: Signal 'Exception 0' received. Description: A data abort exception has occurred..
[/code]
What sould I do ???
-
Re: SMS question.
Hi,
From where are you calling this function CreateMsgL()? Can you show the code snippet for it.
-
Re: SMS question.
That was quick ... ;)
I am calling from other class..
little snippet from my code:
[code]
CImplementor::~CImplementor()
{
}
CImplementor::CImplementor()
{
CSmsHandler* iSmsHandler = CSmsHandler::NewL();
}
// This is an implementation of pure virtual fucntion from MDirObserver
void CImplementor::CChange()
{
iSmsHandler->SendMsg();
}
}
[/code]
BTW this snippet derived from MDirObserver it's to check if there is any change in file on directory (It's only for testing...)
thanks...
-
Re: SMS question.
[QUOTE=Dvirus;492789]Hi,
Thanks for the reply.
I did what you advice to me
I have insert the
[code]
CSmsHandler* iSmsHandler = CSmsHandler::NewL();
[/code]
to the constructor of my class.
But the problem is when I calling the function CreateMsgL()
the my program stak on that line:
[Code]
iSmsMtm->SwitchCurrentEntryL( KMsvDraftEntryId );
[/code]
The error:
[code]
Suspended: Signal 'Exception 0' received. Description: A data abort exception has occurred..
[/code]
What sould I do ???[/QUOTE]
Hi,
Declaring it has
CSmsHandler* iSmsHandler = CSmsHandler::NewL();
makes it a automatic variable it loses scope once it is out the api.
You should declare it in the header sth lie
private:
CSmsHandler* iSmsHandler;
and in the ConstructL
iSmsHandler = CSmsHandler::NewL();
-
Re: SMS question.
Hi,
You mentioned the error is coming in code from CreateMsgL() function. I could not understand the flow as to how SendMsg() is related (it may be your implementation requirement)with this.Are you not able to send even a single message or is it happening if you try to send multiple messages.
-
Re: SMS question.
Thanks A lot [B] Sriky [/B] and yogpan!!!!
[COLOR="Red"]Problem Solved!!![/COLOR]
Keep helping people... ;)
Regards,
Dvir.
-
Re: SMS question.
So what was the problem. Was it only the declaration part or was it something else which you figured out later :)
-
Re: SMS question.
bad declaration ;(
I am always falling in that part... this is suppose to be the easy thing.
probably it doesn't... ;)
But don't worry the 'little story' didn't end.. I still need to check some things.... ;)
Thanks again!! and have a nice day...
Dvir.
-
Re: SMS question.
Hi,
That is the practical problem which many people face. But its always good to know better coding practices for the platform in which one is working.
If not gone through you can have a look into this document on coding practices in Symbian this will definitely save lot of your efforts
[url]http://www.forum.nokia.com/info/sw.nokia.com/id/577f8188-14b6-44f2-997e-28724145e726/S60_Platform_Cpp_Coding_Conventions_v2_0_en.pdf.html[/url]
All the best with Symbian programming :)