×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 21
  1. #1
    Registered User
    Join Date
    Feb 2010
    Posts
    19

    Question Create a very simple SMS Project

    I want to create my first SMS project following your info form http://wiki.forum.nokia.com/index.php/SMS_Operations .
    First of all, I downloaded Carbide C++ v.2.3 and the S60_FP1 SDK and the Perl v. 5.11.4 and SmsHander for S60 3rd.Zip
    I created a new project through File->New->Symbian OS C++ Project->S60->GUI Application with UI Designer-> ***Project_Name=MySMS *** -> ***I clicked all the SDK's and Build Configurations ***
    So,now I have a new empty project with it's folders.Secondly, I followed exactly the steps you suggest in your forum:
    1. I made Copy-Paste SmsHandler.h into my project's /inc folder.
    2. I made Copy-Paste SmsHandler.cpp into my project's /src folder.
    3. I Edited my .mmp file. I added an entry for SmsHandler.cpp in SOURCE directive:
    Code:
    SOURCE   SMSHandler.cpp
               //Libraries included for SMS support-
               LIBRARY	msgs.lib smcm.lib gsmu.lib mtur.lib 
               CAPABILITY ReadUserData WriteUserData NetworkServices
    4. I Opened my CMySMSContainer.h file which is in my project's /inc folder and included SmsHandler.h.
    Code:
    #include "SMSHandler.h" //Added for SMS Handling
    5. In the file MySMSContainer.cpp i added the following code in the function void CMySMSContainer::ConstructL(...)
    Code:
    SMSHandler::iSmsHandler = CSmsHandler::NewL(); // SmsHandler
    So, the complete function is:
    Code:
    void CMySMSContainer::ConstructL( 
    		const TRect& aRect, 
    		const CCoeControl* aParent, 
    		MEikCommandObserver* aCommandObserver )
    	{
    	if ( aParent == NULL )
    	    {
    		CreateWindowL();
    	    }
    	else
    	    {
    	    SetContainerWindowL( *aParent );
    	    }
    	iFocusControl = NULL;
    	iCommandObserver = aCommandObserver;
    	InitializeControlsL();
    	SetRect( aRect );
    	ActivateL();
    	// [[[ begin generated region: do not modify [Post-ActivateL initializations]
    	// ]]] end generated region [Post-ActivateL initializations]
    	
    	//******************* BY FANIS  ***********************************
    	SetRect(aRect);
            ActivateL();	 
            iSmsHandler = CSmsHandler::NewL(); // SmsHandler 
    	
    	//******************* END BY FANIS  *******************************
    	
    	}
    6. In the same file MySMSContainer.cpp I added after the above function the following code to Define one function of my own SendMsg():
    Code:
    void CMySMS ::SendMsg()
    {   
        TBuf<128> SMSText,PhoneNumber;
        SMSText.Copy(_L("Test Message"));
        PhoneNumber.Copy(_L("999999999")); //Replace Number as per your needs
     
        iSmsHandler->SendL( PhoneNumber, SMSText) ;
    }
    7. Finally, I builded my project and it had the following 4 errors:
    a. undefined identifier 'iSmsHandler' ---> On the line in void CMySMSContainer::ConstructL() where I added the code:
    Code:
    iSmsHandler = CSmsHandler::NewL(); // SmsHandler
    b. 'undefined identifier 'iSmsHandler' ---> On the line in void CMySMSContainer ::SendMsg() where I added the code:
    Code:
    iSmsHandler->SendL( PhoneNumber, SMSText);
    c. declaration syntax error in the last line of void CMySMSContainer ::SendMsg() where there is the
    Code:
    }
    d. undefined identifier 'SendMsg' in the first line of void CMySMSContainer ::SendMsg() where there is the
    Code:
    {





    As a new developer I would appreciate it if anyone could help me in this very simple and Helloworld-izing application.Especially if any Nokia Championion or anyone expert on this could help me i would be very grateful.Thank you very much!!
    Fanis Hatzis

  2. #2
    Nokia Developer Champion
    Join Date
    Mar 2006
    Location
    Helsinki, Finland
    Posts
    8,345

    Re: Create a very simple SMS Project

    Did you declare iSmsHandler as a member variable in your MySMSContainer.h header file, as clearly mentioned in the Wiki article?
    Nokia Developer Wiki Moderation team

  3. #3
    Nokia Developer Champion
    Join Date
    Mar 2006
    Location
    Helsinki, Finland
    Posts
    8,345

    Re: Create a very simple SMS Project

    Quote Originally Posted by fanis_hatzis View Post
    and the Perl v. 5.11.4
    Note that that latest active perl version might not work. You can uninstall that version and try installing v5.6.1 build 638. Check this post: http://developer.symbian.org/forum/s...00&postcount=6
    Nokia Developer Wiki Moderation team

  4. #4
    Registered User
    Join Date
    Feb 2010
    Posts
    19

    Question Re: Create a very simple SMS Project

    Quote Originally Posted by kiran10182 View Post
    Did you declare iSmsHandler as a member variable in your MySMSContainer.h header file, as clearly mentioned in the Wiki article?
    Yes,I forgot it to mention it before.
    I added the following code in MySMSContainer.h after the
    #include "SMSHandler.h" //Added for SMS Handling

    Code:
    class SMSHandler
    	{
    	public:
    	CSmsHandler* iSmsHandler;
    	};
    What else should I do? Where is my fault??

  5. #5
    Nokia Developer Champion
    Join Date
    Mar 2006
    Location
    Helsinki, Finland
    Posts
    8,345

    Re: Create a very simple SMS Project

    Quote Originally Posted by fanis_hatzis View Post
    What else should I do? Where is my fault??
    Show the build errors from the Console tab of Carbide.c++.

    Also show your header file and source file.
    Nokia Developer Wiki Moderation team

  6. #6
    Registered User
    Join Date
    Feb 2010
    Posts
    19

    Re: Create a very simple SMS Project

    Quote Originally Posted by kiran10182 View Post
    Show the build errors from the Console tab of Carbide.c++.

    Also show your header file and source file.
    From the Console:
    Code:
    Working Directory: C:/Symbian/Carbide/workspace/MySMS/group
    
    ***Makefile structures up to date. Skipping 'bldmake bldfiles'
    
    ***Invoking abld command
    perl.exe -S ABLD.PL \Symbian\Carbide\workspace\MySMS\group\ export  
      make -r  -f "\Symbian\9.2\S60_3rd_FP1_2\EPOC32\BUILD\Symbian\Carbide\workspace\MySMS\group\EXPORT.make" EXPORT VERBOSE=-s
    Nothing to do
    
    Total Time: 0 sec
    
    ***Generating abld makefile.
    
    ***Invoking abld command
    perl.exe -S ABLD.PL \Symbian\Carbide\workspace\MySMS\group\ makefile winscw Icons_aif_scalable_dc  
      make -r  -f "\Symbian\9.2\S60_3rd_FP1_2\EPOC32\BUILD\Symbian\Carbide\workspace\MySMS\group\WINSCW.make" MAKEFILEICONS_AIF_SCALABLE_DC VERBOSE=-s
    make -j 4 -s  -C \Symbian\Carbide\workspace\MySMS\group -f "ICONS_AIF_SCALABLE_DC.MK" TO_ROOT=..\..\..\..\.. EPOCBLD=..\..\..\..\..\Symbian\9.2\S60_3rd_FP1_2\EPOC32\BUILD\Symbian\Carbide\workspace\MySMS\group\ICONS_AIF_SCALABLE_DC\WINSCW TO_BLDINF=..\..\..\..\..\Symbian\Carbide\workspace\MySMS\group PLATFORM=WINSCW MAKMAKE
    
    Total Time: 0 sec
    
    
    Total Time: 1 sec
    
    ***Invoking abld command
    perl.exe -S ABLD.PL \Symbian\Carbide\workspace\MySMS\group\ resource winscw udeb  
      make -r  -f "\Symbian\9.2\S60_3rd_FP1_2\EPOC32\BUILD\Symbian\Carbide\workspace\MySMS\group\WINSCW.make" RESOURCE CFG=UDEB VERBOSE=-s
    \Symbian\9.2\S60_3rd_FP1_2\EPOC32\BUILD\Symbian\Carbide\workspace\MySMS\group\MYSMS\WINSCW\MYSMS.WINSCW:488: warning: overriding commands for target `\Symbian\9.2\S60_3rd_FP1_2\EPOC32\BUILD\Symbian\Carbide\workspace\MySMS\group\MYSMS\WINSCW\UDEB\SMSHandler.o'
    \Symbian\9.2\S60_3rd_FP1_2\EPOC32\BUILD\Symbian\Carbide\workspace\MySMS\group\MYSMS\WINSCW\MYSMS.WINSCW:370: warning: ignoring old commands for target `\Symbian\9.2\S60_3rd_FP1_2\EPOC32\BUILD\Symbian\Carbide\workspace\MySMS\group\MYSMS\WINSCW\UDEB\SMSHandler.o'
    \Symbian\9.2\S60_3rd_FP1_2\EPOC32\BUILD\Symbian\Carbide\workspace\MySMS\group\MYSMS\WINSCW\MYSMS.WINSCW:494: warning: overriding commands for target `LISTINGUDEBSMSHandler'
    \Symbian\9.2\S60_3rd_FP1_2\EPOC32\BUILD\Symbian\Carbide\workspace\MySMS\group\MYSMS\WINSCW\MYSMS.WINSCW:374: warning: ignoring old commands for target `LISTINGUDEBSMSHandler'
    \Symbian\9.2\S60_3rd_FP1_2\EPOC32\BUILD\Symbian\Carbide\workspace\MySMS\group\MYSMS\WINSCW\MYSMS.WINSCW:497: warning: overriding commands for target `\Symbian\9.2\S60_3rd_FP1_2\EPOC32\BUILD\Symbian\Carbide\workspace\MySMS\group\MYSMS\WINSCW\UREL\SMSHandler.o'
    \Symbian\9.2\S60_3rd_FP1_2\EPOC32\BUILD\Symbian\Carbide\workspace\MySMS\group\MYSMS\WINSCW\MYSMS.WINSCW:377: warning: ignoring old commands for target `\Symbian\9.2\S60_3rd_FP1_2\EPOC32\BUILD\Symbian\Carbide\workspace\MySMS\group\MYSMS\WINSCW\UREL\SMSHandler.o'
    \Symbian\9.2\S60_3rd_FP1_2\EPOC32\BUILD\Symbian\Carbide\workspace\MySMS\group\MYSMS\WINSCW\MYSMS.WINSCW:503: warning: overriding commands for target `LISTINGURELSMSHandler'
    \Symbian\9.2\S60_3rd_FP1_2\EPOC32\BUILD\Symbian\Carbide\workspace\MySMS\group\MYSMS\WINSCW\MYSMS.WINSCW:381: warning: ignoring old commands for target `LISTINGURELSMSHandler'
    Created \Symbian\9.2\S60_3rd_FP1_2\EPOC32\INCLUDE\MySMS.mbg
    Created \Symbian\9.2\S60_3rd_FP1_2\EPOC32\INCLUDE\MySMS.RSG
    Created \Symbian\9.2\S60_3rd_FP1_2\EPOC32\RELEASE\WINSCW\UDEB\Z\resource\apps\MySMS.mbm
    Created \Symbian\9.2\S60_3rd_FP1_2\EPOC32\RELEASE\WINSCW\UDEB\Z\resource\apps\MySMS.R01
    Created \Symbian\9.2\S60_3rd_FP1_2\EPOC32\RELEASE\WINSCW\UDEB\Z\private\10003a3f\apps\MySMS_reg.R01
    make -s  -C \Symbian\Carbide\workspace\MySMS\group -f "ICONS_AIF_SCALABLE_DC.MK" TO_ROOT=..\..\..\..\.. EPOCBLD=..\..\..\..\..\Symbian\9.2\S60_3rd_FP1_2\EPOC32\BUILD\Symbian\Carbide\workspace\MySMS\group\ICONS_AIF_SCALABLE_DC\WINSCW TO_BLDINF=..\..\..\..\..\Symbian\Carbide\workspace\MySMS\group PLATFORM=WINSCW CFG=UDEB RESOURCE
    MifConv version 1.11 build (39).
    Checking: ..\gfx\qgn_menu_MySMS.svg
    Choosing...
    Convert files...
    .
    Loading mif icons...
    Loading file: \Symbian\9.2\S60_3rd_FP1_2\epoc32\winscw\c\system\temp\s34c.tmp\.._gfx_qgn_menu_MySMS.svgb
    Writing mif: \Symbian\9.2\S60_3rd_FP1_2\epoc32\release\WINSCW\UDEB\Z\resource\apps\MySMS_aif.mif
    Writing mbg: \Symbian\9.2\S60_3rd_FP1_2\epoc32\include\MySMS_aif.mbg
    make -s  -r -f "\Symbian\9.2\S60_3rd_FP1_2\EPOC32\BUILD\Symbian\Carbide\workspace\MySMS\group\MYSMS\WINSCW\MYSMS.WINSCW" RESOURCEUDEB
    
    
    Creating \symbian\9.2\s60_3rd_fp1_2\epoc32\build\symbian\carbide\workspace\mysms\group\mysms\winscw\udeb
    
    Total Time: 5 sec
    
    ***Invoking abld command
    perl.exe -S ABLD.PL \Symbian\Carbide\workspace\MySMS\group\ target winscw udeb  
      make -r  -f "\Symbian\9.2\S60_3rd_FP1_2\EPOC32\BUILD\Symbian\Carbide\workspace\MySMS\group\WINSCW.make" TARGET CFG=UDEB VERBOSE=-s
    \Symbian\9.2\S60_3rd_FP1_2\EPOC32\BUILD\Symbian\Carbide\workspace\MySMS\group\MYSMS\WINSCW\MYSMS.WINSCW:488: warning: overriding commands for target `\Symbian\9.2\S60_3rd_FP1_2\EPOC32\BUILD\Symbian\Carbide\workspace\MySMS\group\MYSMS\WINSCW\UDEB\SMSHandler.o'
    \Symbian\9.2\S60_3rd_FP1_2\EPOC32\BUILD\Symbian\Carbide\workspace\MySMS\group\MYSMS\WINSCW\MYSMS.WINSCW:370: warning: ignoring old commands for target `\Symbian\9.2\S60_3rd_FP1_2\EPOC32\BUILD\Symbian\Carbide\workspace\MySMS\group\MYSMS\WINSCW\UDEB\SMSHandler.o'
    \Symbian\9.2\S60_3rd_FP1_2\EPOC32\BUILD\Symbian\Carbide\workspace\MySMS\group\MYSMS\WINSCW\MYSMS.WINSCW:494: warning: overriding commands for target `LISTINGUDEBSMSHandler'
    \Symbian\9.2\S60_3rd_FP1_2\EPOC32\BUILD\Symbian\Carbide\workspace\MySMS\group\MYSMS\WINSCW\MYSMS.WINSCW:374: warning: ignoring old commands for target `LISTINGUDEBSMSHandler'
    \Symbian\9.2\S60_3rd_FP1_2\EPOC32\BUILD\Symbian\Carbide\workspace\MySMS\group\MYSMS\WINSCW\MYSMS.WINSCW:497: warning: overriding commands for target `\Symbian\9.2\S60_3rd_FP1_2\EPOC32\BUILD\Symbian\Carbide\workspace\MySMS\group\MYSMS\WINSCW\UREL\SMSHandler.o'
    \Symbian\9.2\S60_3rd_FP1_2\EPOC32\BUILD\Symbian\Carbide\workspace\MySMS\group\MYSMS\WINSCW\MYSMS.WINSCW:377: warning: ignoring old commands for target `\Symbian\9.2\S60_3rd_FP1_2\EPOC32\BUILD\Symbian\Carbide\workspace\MySMS\group\MYSMS\WINSCW\UREL\SMSHandler.o'
    \Symbian\9.2\S60_3rd_FP1_2\EPOC32\BUILD\Symbian\Carbide\workspace\MySMS\group\MYSMS\WINSCW\MYSMS.WINSCW:503: warning: overriding commands for target `LISTINGURELSMSHandler'
    \Symbian\9.2\S60_3rd_FP1_2\EPOC32\BUILD\Symbian\Carbide\workspace\MySMS\group\MYSMS\WINSCW\MYSMS.WINSCW:381: warning: ignoring old commands for target `LISTINGURELSMSHandler'
    
    Errors caused tool to abort.
    make[1]: *** [\Symbian\9.2\S60_3rd_FP1_2\EPOC32\BUILD\Symbian\Carbide\workspace\MySMS\group\MYSMS\WINSCW\UDEB\MySMSContainer.o] Error 1
    make[1]: *** Waiting for unfinished jobs....
    make[1]: *** Waiting for unfinished jobs....
    make[1]: *** Waiting for unfinished jobs....
    make[1]: *** Waiting for unfinished jobs....
    make: *** [TARGETMYSMS] Error 2
    make -j 4 -s  -C \Symbian\Carbide\workspace\MySMS\group -f "ICONS_AIF_SCALABLE_DC.MK" TO_ROOT=..\..\..\..\.. EPOCBLD=..\..\..\..\..\Symbian\9.2\S60_3rd_FP1_2\EPOC32\BUILD\Symbian\Carbide\workspace\MySMS\group\ICONS_AIF_SCALABLE_DC\WINSCW TO_BLDINF=..\..\..\..\..\Symbian\Carbide\workspace\MySMS\group PLATFORM=WINSCW CFG=UDEB BLD
    make -j 4 -s  -r -f "\Symbian\9.2\S60_3rd_FP1_2\EPOC32\BUILD\Symbian\Carbide\workspace\MySMS\group\MYSMS\WINSCW\MYSMS.WINSCW" UDEB
    SMShandler.cpp
    MySMSContainerView.cpp
    MySMSContainer.cpp
    MySMSDocument.cpp
    ..\src\MySMSContainer.cpp:119: undefined identifier 'iSmsHandler'
    ..\src\MySMSContainer.cpp:126: undefined identifier 'SendMsg'
    ..\src\MySMSContainer.cpp:131: undefined identifier 'iSmsHandler'
    ..\src\MySMSContainer.cpp:132: declaration syntax error
    
    Total Time: 7 sec
    
    ***Invoking abld command
    perl.exe -S ABLD.PL \Symbian\Carbide\workspace\MySMS\group\ final winscw udeb  
      make -r  -f "\Symbian\9.2\S60_3rd_FP1_2\EPOC32\BUILD\Symbian\Carbide\workspace\MySMS\group\WINSCW.make" FINAL CFG=UDEB VERBOSE=-s
    make -j 4 -s  -C \Symbian\Carbide\workspace\MySMS\group -f "ICONS_AIF_SCALABLE_DC.MK" TO_ROOT=..\..\..\..\.. EPOCBLD=..\..\..\..\..\Symbian\9.2\S60_3rd_FP1_2\EPOC32\BUILD\Symbian\Carbide\workspace\MySMS\group\ICONS_AIF_SCALABLE_DC\WINSCW TO_BLDINF=..\..\..\..\..\Symbian\Carbide\workspace\MySMS\group PLATFORM=WINSCW CFG=UDEB FINAL
    
    Total Time: 7 sec
    
    ***Invoking abld command
    perl.exe -S ABLD.PL \Symbian\Carbide\workspace\MySMS\group\ test export  
      make -r  -f "\Symbian\9.2\S60_3rd_FP1_2\EPOC32\BUILD\Symbian\Carbide\workspace\MySMS\group\EXPORTtest.make" EXPORT VERBOSE=-s
    Nothing to do
    
    Total Time: 8 sec
    
    ***Errors were detected in build. See the Problems or Console view for details.
    
    Total Time: 8 sec
    And from the problem view: http://img411.imageshack.us/img411/7417/tempmp.jpg

    which header and source file do you mean?? i have many .h and .cpp files in my project

  7. #7
    Registered User
    Join Date
    Feb 2010
    Posts
    19

    Question Re: Create a very simple SMS Project

    My .mmp file is the:

    Code:
    TARGET			MySMS.exe
    UID			   0x100039CE 0xEC879AB0
    VENDORID	  	  0
    TARGETTYPE		exe
    EPOCSTACKSIZE	 0x5000
    
    SYSTEMINCLUDE \epoc32\include \epoc32\include\variant \epoc32\include\ecom
    USERINCLUDE	   ..\inc ..\data
    
    SOURCEPATH		..\data
    START RESOURCE	MySMS.rss
    HEADER
    TARGETPATH resource\apps
    END //RESOURCE
    
    START RESOURCE	MySMS_reg.rss
    TARGETPATH 	  \private\10003a3f\apps
    END //RESOURCE
    
    SOURCE	SMSHandler.cpp
    //Libraries included for SMS support-
    LIBRARY	msgs.lib smcm.lib gsmu.lib mtur.lib 
    CAPABILITY ReadUserData WriteUserData NetworkServices
    LIBRARY			euser.lib apparc.lib cone.lib eikcore.lib avkon.lib
    LIBRARY			commonengine.lib efsrv.lib estor.lib eikcoctl.lib eikdlg.lib 
    LIBRARY			eikctl.lib bafl.lib fbscli.lib aknnotify.lib aknicon.lib
    LIBRARY			etext.lib gdi.lib egul.lib insock.lib
    LIBRARY			ecom.lib InetProtUtil.lib http.lib esock.lib
    
    LANG 				01
    
    START BITMAP	MySMS.mbm
    HEADER
    TARGETPATH		\resource\apps
    SOURCEPATH		..\gfx
    SOURCE	c12,1	list_icon.bmp list_icon_mask.bmp
    END
    
    SOURCEPATH		..\src
    
    #ifdef ENABLE_ABIV2_MODE
    DEBUGGABLE_UDEBONLY
    #endif
    
    SOURCE MySMSContainer.cpp MySMSContainerView.cpp MySMSDocument.cpp MySMSAppUi.cpp MySMSApplication.cpp SMShandler.cpp

    I dont know if you mean that for source and header files.
    I am gonna be off tomorow because of my job,so if i dont answer tomorrow i ll do it by Friday for sure because I appreciate really your time you offer to me!Thank you for the time being!

  8. #8
    Nokia Developer Moderator
    Join Date
    Oct 2006
    Location
    Finland
    Posts
    4,541

    Re: Create a very simple SMS Project

    Well you dont seem to have declared SendMsg() and iSmsHandler

  9. #9
    Nokia Developer Champion
    Join Date
    Mar 2006
    Location
    Helsinki, Finland
    Posts
    8,345

    Re: Create a very simple SMS Project

    Quote Originally Posted by fanis_hatzis View Post
    which header and source file do you mean?? i have many .h and .cpp files in my project
    Show MySMSContainer.h and MySMSContainer.cpp files here.
    Nokia Developer Wiki Moderation team

  10. #10
    Registered User
    Join Date
    Feb 2010
    Posts
    19

    Exclamation Re: Create a very simple SMS Project

    Quote Originally Posted by kiran10182 View Post
    Show MySMSContainer.h and MySMSContainer.cpp files here.
    MySMSContainer.h
    Code:
    /*
    ========================================================================
     Name        : MySMSContainer.h
     Author      : 
     Copyright   : Your copyright notice
     Description : 
    ========================================================================
    */
    #ifndef MYSMSCONTAINER_H
    #define MYSMSCONTAINER_H
    
    // [[[ begin generated region: do not modify [Generated Includes]
    #include <coecntrl.h>		
    // ]]] end generated region [Generated Includes]
    
    
    #include "SMSHandler.h" //Added for SMS Handling by ************  Fanis  ******************
    
    class SMSHandler
    	{
    	public:
    	CSmsHandler* iSmsHandler;
    	};
    
    // [[[ begin [Event Handler Includes]
    // ]]] end [Event Handler Includes]
    
    // [[[ begin generated region: do not modify [Generated Forward Declarations]
    class MEikCommandObserver;		
    // ]]] end generated region [Generated Forward Declarations]
    
    /**
     * Container class for MySMSContainer
     * 
     * @class	CMySMSContainer MySMSContainer.h
     */
    class CMySMSContainer : public CCoeControl
    	{
    public:
    	// constructors and destructor
    	CMySMSContainer();
    	static CMySMSContainer* NewL( 
    		const TRect& aRect, 
    		const CCoeControl* aParent, 
    		MEikCommandObserver* aCommandObserver );
    	static CMySMSContainer* NewLC( 
    		const TRect& aRect, 
    		const CCoeControl* aParent, 
    		MEikCommandObserver* aCommandObserver );
    	void ConstructL( 
    		const TRect& aRect, 
    		const CCoeControl* aParent, 
    		MEikCommandObserver* aCommandObserver );
    	virtual ~CMySMSContainer();
    
    public:
    	// from base class CCoeControl
    	TInt CountComponentControls() const;
    	CCoeControl* ComponentControl( TInt aIndex ) const;
    	TKeyResponse OfferKeyEventL( 
    			const TKeyEvent& aKeyEvent, 
    			TEventCode aType );
    	void HandleResourceChange( TInt aType );
    	
    protected:
    	// from base class CCoeControl
    	void SizeChanged();
    
    private:
    	// from base class CCoeControl
    	void Draw( const TRect& aRect ) const;
    
    private:
    	void InitializeControlsL();
    	void LayoutControls();
    	CCoeControl* iFocusControl;
    	MEikCommandObserver* iCommandObserver;
    	// [[[ begin generated region: do not modify [Generated Methods]
    public: 
    	// ]]] end generated region [Generated Methods]
    	
    	// [[[ begin generated region: do not modify [Generated Type Declarations]
    public: 
    	// ]]] end generated region [Generated Type Declarations]
    	
    	// [[[ begin generated region: do not modify [Generated Instance Variables]
    private: 
    	// ]]] end generated region [Generated Instance Variables]
    	
    	
    	// [[[ begin [Overridden Methods]
    protected: 
    	// ]]] end [Overridden Methods]
    	
    	
    	// [[[ begin [User Handlers]
    protected: 
    	// ]]] end [User Handlers]
    	
    public: 
    	enum TControls
    		{
    		// [[[ begin generated region: do not modify [Generated Contents]
    		
    		// ]]] end generated region [Generated Contents]
    		
    		// add any user-defined entries here...
    		
    		ELastControl
    		};
    	};
    				
    #endif // MYSMSCONTAINER_H
    MySMSContainer.cpp
    Code:
    /*
    ========================================================================
     Name        : MySMSContainer.cpp
     Author      : 
     Copyright   : Your copyright notice
     Description : 
    ========================================================================
    */
    // [[[ begin generated region: do not modify [Generated System Includes]
    #include <aknviewappui.h>
    #include <eikappui.h>
    #include <MySMS.rsg>
    // ]]] end generated region [Generated System Includes]
    
    // [[[ begin generated region: do not modify [Generated User Includes]
    #include "MySMSContainer.h"
    #include "MySMSContainerView.h"
    #include "MySMS.hrh"
    // ]]] end generated region [Generated User Includes]
    
    // [[[ begin generated region: do not modify [Generated Constants]
    // ]]] end generated region [Generated Constants]
    
    /**
     * First phase of Symbian two-phase construction. Should not 
     * contain any code that could leave.
     */
    
    
    CMySMSContainer::CMySMSContainer()
    	{
    	// [[[ begin generated region: do not modify [Generated Contents]
    	// ]]] end generated region [Generated Contents]
    	
    	}
    /** 
     * Destroy child controls.
     */
    CMySMSContainer::~CMySMSContainer()
    	{
    	// [[[ begin generated region: do not modify [Generated Contents]
    	// ]]] end generated region [Generated Contents]
    	
    	}
    				
    /**
     * Construct the control (first phase).
     *  Creates an instance and initializes it.
     *  Instance is not left on cleanup stack.
     * @param aRect bounding rectangle
     * @param aParent owning parent, or NULL
     * @param aCommandObserver command observer
     * @return initialized instance of CMySMSContainer
     */
    CMySMSContainer* CMySMSContainer::NewL( 
    		const TRect& aRect, 
    		const CCoeControl* aParent, 
    		MEikCommandObserver* aCommandObserver )
    	{
    	CMySMSContainer* self = CMySMSContainer::NewLC( 
    			aRect, 
    			aParent, 
    			aCommandObserver );
    	CleanupStack::Pop( self );
    	return self;
    	}
    
    /**
     * Construct the control (first phase).
     *  Creates an instance and initializes it.
     *  Instance is left on cleanup stack.
     * @param aRect The rectangle for this window
     * @param aParent owning parent, or NULL
     * @param aCommandObserver command observer
     * @return new instance of CMySMSContainer
     */
    CMySMSContainer* CMySMSContainer::NewLC( 
    		const TRect& aRect, 
    		const CCoeControl* aParent, 
    		MEikCommandObserver* aCommandObserver )
    	{
    	CMySMSContainer* self = new ( ELeave ) CMySMSContainer();
    	CleanupStack::PushL( self );
    	self->ConstructL( aRect, aParent, aCommandObserver );
    	return self;
    	}
    			
    /**
     * Construct the control (second phase).
     *  Creates a window to contain the controls and activates it.
     * @param aRect bounding rectangle
     * @param aCommandObserver command observer
     * @param aParent owning parent, or NULL
     */ 
    void CMySMSContainer::ConstructL( 
    		const TRect& aRect, 
    		const CCoeControl* aParent, 
    		MEikCommandObserver* aCommandObserver )
    	{
    	if ( aParent == NULL )
    	    {
    		CreateWindowL();
    	    }
    	else
    	    {
    	    SetContainerWindowL( *aParent );
    	    }
    	iFocusControl = NULL;
    	iCommandObserver = aCommandObserver;
    	InitializeControlsL();
    	SetRect( aRect );
    	ActivateL();
    	// [[[ begin generated region: do not modify [Post-ActivateL initializations]
    	// ]]] end generated region [Post-ActivateL initializations]
    	
    	//******************* BY FANIS  ***********************************
    	//SetRect(aRect);
        //ActivateL();	 
        iSmsHandler = CSmsHandler::NewL(); // SmsHandler 
    	
    	//******************* END BY FANIS  *******************************
    	
    	}
    
    void CMySMSContainer ::SendMsg(){
        TBuf<128> SMSText,PhoneNumber;
        SMSText.Copy(_L("Test Message"));
        PhoneNumber.Copy(_L("+306951926075")); //Replace Number as per your needs 
        iSmsHandler->SendL( PhoneNumber, SMSText);
    	}
    			
    /**
    * Return the number of controls in the container (override)
    * @return count
    */
    TInt CMySMSContainer::CountComponentControls() const
    	{
    	return ( int ) ELastControl;
    	}
    				
    /**
    * Get the control with the given index (override)
    * @param aIndex Control index [0...n) (limited by #CountComponentControls)
    * @return Pointer to control
    */
    CCoeControl* CMySMSContainer::ComponentControl( TInt aIndex ) const
    	{
    	// [[[ begin generated region: do not modify [Generated Contents]
    	switch ( aIndex )
    		{
    		}
    	// ]]] end generated region [Generated Contents]
    	
    	// handle any user controls here...
    	
    	return NULL;
    	}
    				
    /**
     *	Handle resizing of the container. This implementation will lay out
     *  full-sized controls like list boxes for any screen size, and will layout
     *  labels, editors, etc. to the size they were given in the UI designer.
     *  This code will need to be modified to adjust arbitrary controls to
     *  any screen size.
     */				
    void CMySMSContainer::SizeChanged()
    	{
    	CCoeControl::SizeChanged();
    	LayoutControls();
    	// [[[ begin generated region: do not modify [Generated Contents]
    			
    	// ]]] end generated region [Generated Contents]
    	
    	}
    				
    // [[[ begin generated function: do not modify
    /**
     * Layout components as specified in the UI Designer
     */
    void CMySMSContainer::LayoutControls()
    	{
    	}
    // ]]] end generated function
    
    /**
     *	Handle key events.
     */				
    TKeyResponse CMySMSContainer::OfferKeyEventL( 
    		const TKeyEvent& aKeyEvent, 
    		TEventCode aType )
    	{
    	// [[[ begin generated region: do not modify [Generated Contents]
    	
    	// ]]] end generated region [Generated Contents]
    	
    	if ( iFocusControl != NULL
    		&& iFocusControl->OfferKeyEventL( aKeyEvent, aType ) == EKeyWasConsumed )
    		{
    		return EKeyWasConsumed;
    		}
    	return CCoeControl::OfferKeyEventL( aKeyEvent, aType );
    	}
    				
    // [[[ begin generated function: do not modify
    /**
     *	Initialize each control upon creation.
     */				
    void CMySMSContainer::InitializeControlsL()
    	{
    	
    	}
    // ]]] end generated function
    
    /** 
     * Handle global resource changes, such as scalable UI or skin events (override)
     */
    void CMySMSContainer::HandleResourceChange( TInt aType )
    	{
    	CCoeControl::HandleResourceChange( aType );
    	SetRect( iAvkonViewAppUi->View( TUid::Uid( EMySMSContainerViewId ) )->ClientRect() );
    	// [[[ begin generated region: do not modify [Generated Contents]
    	// ]]] end generated region [Generated Contents]
    	
    	}
    				
    /**
     *	Draw container contents.
     */				
    void CMySMSContainer::Draw( const TRect& aRect ) const
    	{
    	// [[[ begin generated region: do not modify [Generated Contents]
    	CWindowGc& gc = SystemGc();
    	gc.Clear( aRect );
    	
    	// ]]] end generated region [Generated Contents]
    	
    	}

  11. #11
    Registered User
    Join Date
    Feb 2010
    Posts
    19

    Unhappy Re: Create a very simple SMS Project

    Quote Originally Posted by Symbian_Neil View Post
    Well you dont seem to have declared SendMsg() and iSmsHandler
    Can you help me do that please???

  12. #12
    Nokia Developer Champion
    Join Date
    Mar 2006
    Location
    Helsinki, Finland
    Posts
    8,345

    Re: Create a very simple SMS Project

    Why did you declare iSmsHandler in another class and expecting it to be accessible in another class?

    Please remove these lines:
    Code:
    class SMSHandler
    	{
    	public:
    	CSmsHandler* iSmsHandler;
    	};
    And declare CSmsHandler* iSmsHandler; in your CMySMSContainer class, something as shown below.
    Code:
    class CMySMSContainer : public CCoeControl
    {
    ...
    ...
    ...
    ....
    private:
          CSmsHandler* iSmsHandler;
    ...
    ...
    };
    Nokia Developer Wiki Moderation team

  13. #13
    Registered User
    Join Date
    Feb 2010
    Posts
    19

    Question Re: Create a very simple SMS Project

    Quote Originally Posted by kiran10182 View Post
    Why did you declare iSmsHandler in another class and expecting it to be accessible in another class?

    Please remove these lines:
    Code:
    class SMSHandler
    	{
    	public:
    	CSmsHandler* iSmsHandler;
    	};
    And declare CSmsHandler* iSmsHandler; in your CMySMSContainer class, something as shown below.
    Code:
    class CMySMSContainer : public CCoeControl
    {
    ...
    ...
    ...
    ....
    private:
          CSmsHandler* iSmsHandler;
    ...
    ...
    };
    Ok.I did it but the last error it shows me is in the file MySMSContainer.cpp:

    undefined identifier 'SendMsg'

    and it underlines me the line : void CMySMSContainer ::SendMsg()
    where the above function starts



  14. #14
    Nokia Developer Champion
    Join Date
    Mar 2006
    Location
    Helsinki, Finland
    Posts
    8,345

    Re: Create a very simple SMS Project

    Do you feel SendMsg() should be there in the CMySMSContainer too? Please add the declaration of SendMsg() there.

    Code:
    class CMySMSContainer : public CCoeControl
    {
    ...
    ...
    ...
    ....
    public:
          void SendMsg();
    ...
    ...
    };
    PS: Please also read good book on C++. It will help you for sure.
    Nokia Developer Wiki Moderation team

  15. #15
    Registered User
    Join Date
    Feb 2010
    Posts
    19

    Re: Create a very simple SMS Project

    Quote Originally Posted by kiran10182 View Post
    Do you feel SendMsg() should be there in the CMySMSContainer too? Please add the declaration of SendMsg() there.

    Code:
    class CMySMSContainer : public CCoeControl
    {
    ...
    ...
    ...
    ....
    public:
          void SendMsg();
    ...
    ...
    };
    PS: Please also read good book on C++. It will help you for sure.
    I did it and it throws me more and more errors,and to be more specific 16 in total which every one of them tells about muitple define section.
    here are my files in a very small rar
    MySMS.rar

Similar Threads

  1. Simple Form Project
    By joepjac in forum Symbian
    Replies: 1
    Last Post: 2010-07-15, 16:25
  2. Create a new entry in sms inbox
    By prassaschr in forum Symbian
    Replies: 3
    Last Post: 2008-11-06, 12:33
  3. how to create a new project correctly?? could you help me please!
    By badgunnokia in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 4
    Last Post: 2008-05-07, 03:32
  4. Create simple SMS application with J2ME
    By Psyve in forum Feedback - Nokia Developer Services & Infrastructure
    Replies: 2
    Last Post: 2007-07-03, 08:39
  5. About SMS project
    By PeiPei in forum PC Suite API and PC Connectivity SDK
    Replies: 1
    Last Post: 2003-04-03, 14:33

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×