×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 25
  1. #1
    Registered User
    Join Date
    Mar 2009
    Location
    Chennai, India
    Posts
    49

    Question Integrate HTTPClientExample project with HelloWorld Application

    I want to make HTTP POST request to a URL and show the response text back to the user.

    I download the HTTPClientExample project from here - http://www.forum.nokia.com/info/sw.n..._2_en.zip.html

    I browsed through the HTTPClientExample source files. To start off, I copied the ClientEngine.h and ClientEngine.cpp to my project folder structure.
    In their ClientAppUI.cpp, CClientAppUi::ConstructL(), they have declared iEngine as

    Code:
    void CClientAppUi::ConstructL()
      {
        BaseConstructL(EAknEnableSkin);
    
        iAppView = CClientAppView::NewL(ClientRect());
        AddToStackL(iAppView);
    
        iEngine = CClientEngine::NewL(*iAppView);
      }
    So, now I am confused where I should place the iEngine initialization code in my project. In the HeloWorldContainerView.cpp or HelloWorldAppUi.cpp. Please tell me in which constructor I should add the initialization code. (I see 2 to 3 constructor like functions in each file)

    Once I declare iEngine, I could make HTTP POST request using the following code

    Code:
          TRAPD(err, iEngine->IssueHTTPPostL(uri8, KMimeType, postData8));

  2. #2
    Registered User
    Join Date
    Dec 2009
    Posts
    339

    Re: Integrate HTTPClientExample project with HelloWorld Application

    Quote Originally Posted by emaillenin View Post
    So, now I am confused where I should place the iEngine initialization code in my project. In the HeloWorldContainerView.cpp or HelloWorldAppUi.cpp. Please tell me in which constructor I should add the initialization code. (I see 2 to 3 constructor like functions in each file)
    what is the problem initializing iEngine in HelloWorldAppUi.cpp constructor?

  3. #3
    Registered User
    Join Date
    Mar 2009
    Location
    Chennai, India
    Posts
    49

    Exclamation Re: Integrate HTTPClientExample project with HelloWorld Application

    Quote Originally Posted by slinx View Post
    what is the problem initializing iEngine in HelloWorldAppUi.cpp constructor?
    Before going there, I tried to build the application after copying ClientEngine.h and ClientEngine.cpp into my project. I have removed the following lines from my ClientEngine.cpp file
    Code:
    #include <HTTPClientExample.rsg>
    
    #include "Client.pan"
    #include "Client.hrh"
    Now I am getting a bunch of errors like these in the ClientEngine.cpp file

    Creation Time Description Resource Path Location Type
    1296402038517 `R_HTTP_TX_CANCELLED' undeclared (first use this function) ClientEngine.cpp /HeySymbian/src line 265 C/C++ Problem
    1296402038518 `R_HTTP_CONNECTING' undeclared (first use this function) ClientEngine.cpp /HeySymbian/src line 299 C/C++ Problem
    1296402038519 `R_HTTP_TX_CANCELLED' undeclared (first use this function) ClientEngine.cpp /HeySymbian/src line 335 C/C++ Problem
    1296402038520 `R_HTTP_CONNECTING' undeclared (first use this function) ClientEngine.cpp /HeySymbian/src line 381 C/C++ Problem

    Is it because I removed the RSG file from the include?

  4. #4
    Registered User
    Join Date
    Dec 2009
    Posts
    339

    Re: Integrate HTTPClientExample project with HelloWorld Application

    yes. Define these things in your .rss file and include .rsg file in .cpp file.

  5. #5
    Registered User
    Join Date
    Mar 2009
    Location
    Chennai, India
    Posts
    49

    Thumbs down Re: Integrate HTTPClientExample project with HelloWorld Application

    Quote Originally Posted by slinx View Post
    yes. Define these things in your .rss file and include .rsg file in .cpp file.
    Now, I have copied the necessary resources from the other RSG file and pasted in my RSG file. Those errors have disappeared.

    Now I have added the iEngine initialization in the following method in the AppUi.Cpp file. (I have also added #include "ClientEngine.cpp")

    Code:
    void CHeySymbianAppUi::InitializeContainersL()
    	{
    	iHeySymbianContainerView = CHeySymbianContainerView::NewL();
    	AddViewL( iHeySymbianContainerView );
    	SetDefaultViewL( *iHeySymbianContainerView );
    	iEngine = CClientEngine::NewL(*iHeySymbianContainerView);
    	}
    The following are the two error I get when I build the project.

    Creation Time Description Resource Path Location Type
    1296403499353 no matching function for call to `CClientEngine::NewL(CHeySymbianContainerView&)' HeySymbianAppUi.cpp /HeySymbian/src line 52 C/C++ Problem
    1296403499352 `iEngine' undeclared (first use this function) HeySymbianAppUi.cpp /HeySymbian/src line 52 C/C++ Problem

  6. #6
    Registered User
    Join Date
    Dec 2009
    Posts
    339

    Re: Integrate HTTPClientExample project with HelloWorld Application

    Quote Originally Posted by emaillenin View Post

    Now I have added the iEngine initialization in the following method in the AppUi.Cpp file. (I have also added #include "ClientEngine.cpp")
    Check this #include "ClientEngine.cpp, should be #include "ClientEngine.h"

  7. #7
    Registered User
    Join Date
    Mar 2009
    Location
    Chennai, India
    Posts
    49

    Re: Integrate HTTPClientExample project with HelloWorld Application

    Quote Originally Posted by slinx View Post
    Check this #include "ClientEngine.cpp, should be #include "ClientEngine.h"
    Tried it. Still the same two errors.

  8. #8
    Registered User
    Join Date
    Dec 2009
    Posts
    339

    Re: Integrate HTTPClientExample project with HelloWorld Application

    you might check whether you have forgotten to change CClientEngine NewL method to take CHeySymbianContainerView object as a parameter. This should be the reason for giving this error.

  9. #9
    Registered User
    Join Date
    Mar 2009
    Location
    Chennai, India
    Posts
    49

    Re: Integrate HTTPClientExample project with HelloWorld Application

    Quote Originally Posted by slinx View Post
    you might check whether you have forgotten to change CClientEngine NewL method to take CHeySymbianContainerView object as a parameter. This should be the reason for giving this error.
    Code:
     
    // ----------------------------------------------------------------------------
    // CClientEngine::NewL()
    // ----------------------------------------------------------------------------
    CClientEngine* CClientEngine::NewL(MClientObserver& aObserver)
      {
        CClientEngine* self = CClientEngine::NewLC(aObserver);
        CleanupStack::Pop(self);
        return self;
      }
    Can you please tell me how to modify this method to my requirement?

  10. #10
    Registered User
    Join Date
    Dec 2009
    Posts
    339

    Re: Integrate HTTPClientExample project with HelloWorld Application

    use MClientObserver as a base class of your view class CHeySymbianContainerView. Like

    Code:
    class CHeySymbianContainerView : public CCoeControl,  public MClientObserver
    {
    
    };

  11. #11
    Registered User
    Join Date
    Mar 2009
    Location
    Chennai, India
    Posts
    49

    Re: Integrate HTTPClientExample project with HelloWorld Application

    Quote Originally Posted by slinx View Post
    use MClientObserver as a base class of your view class CHeySymbianContainerView. Like

    Code:
    class CHeySymbianContainerView : public CCoeControl,  public MClientObserver
    {
    
    };
    I modified HeySymbianContainerView.h like following,

    Code:
    class CHeySymbianContainerView : public CAknView,public CCoeControl,  public MClientObserver
    	{
    Now I am getting many errors like -

    Creation Time Description Resource Path Location Type
    1296406852848 expected class-name before '{' token HeySymbianContainerView.h /HeySymbian/inc line 34 C/C++ Problem
    1296406852849 `CBase' is an ambiguous base of `CHeySymbianContainerView' HeySymbianContainerView.cpp /HeySymbian/src line 80 C/C++ Problem
    1296406852850 `MObjectProvider' is an ambiguous base of `CHeySymbianContainerView' HeySymbianContainerView.cpp /HeySymbian/src line 161 C/C++ Problem
    1296406852851 reference to `iCoeEnv' is ambiguous HeySymbianContainerView.cpp /HeySymbian/src line 229 C/C++ Problem
    1296406852852 candidates are: CCoeEnv*CCoeControl::iCoeEnv HeySymbian line 370 C/C++ Problem
    1296406852853 CCoeEnv*CAknView::iCoeEnv HeySymbian line 386 C/C++ Problem
    1296406852855 reference to `iCoeEnv' is ambiguous HeySymbianContainerView.cpp /HeySymbian/src line 264 C/C++ Problem
    1296406852856 `iCoeEnv' undeclared (first use this function) HeySymbianContainerView.cpp /HeySymbian/src line 264 C/C++ Problem
    1296406852857 `iEngine' undeclared (first use this function) HeySymbianAppUi.cpp /HeySymbian/src line 52 C/C++ Problem
    1296406852858 no matching function for call to `CClientEngine::NewL(CHeySymbianContainerView&)' HeySymbianAppUi.cpp /HeySymbian/src line 52 C/C++ Problem
    1296406852854 `iCoeEnv' undeclared (first use this function) HeySymbianContainerView.cpp /HeySymbian/src line 229 C/C++ Problem

  12. #12
    Registered User
    Join Date
    Dec 2009
    Posts
    339

    Re: Integrate HTTPClientExample project with HelloWorld Application

    Quote Originally Posted by emaillenin View Post

    Code:
    class CHeySymbianContainerView : public CAknView,public CCoeControl,  public MClientObserver
    	{
    CHeySymbianContainerView should be inherited from either CAknView or CCoeControl. U can just use CCoeControl in this case.

  13. #13
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    3,957

    Re: Integrate HTTPClientExample project with HelloWorld Application

    generally any class in symbian c++ should not be derived from two 'C' classes at same time.

  14. #14
    Registered User
    Join Date
    Mar 2009
    Location
    Chennai, India
    Posts
    49

    Re: Integrate HTTPClientExample project with HelloWorld Application

    Quote Originally Posted by slinx View Post
    CHeySymbianContainerView should be inherited from either CAknView or CCoeControl. U can just use CCoeControl in this case.
    Thanks for the reply. Now my HeySymbianContainerView.h looks like below -

    Code:
    class CHeySymbianContainerView : public CCoeControl,  public MClientObserver
    	{
    The following are the errors after this change -

    Creation Time Description Resource Path Location Type
    1296839578438 `BaseConstructL' undeclared (first use this function) HeySymbianContainerView.cpp /HeySymbian/src line 93 C/C++ Problem
    1296839578439 `AppUi' undeclared (first use this function) HeySymbianContainerView.cpp /HeySymbian/src line 135 C/C++ Problem
    1296839578440 `AppUi' undeclared (first use this function) HeySymbianContainerView.cpp /HeySymbian/src line 162 C/C++ Problem
    1296839578441 `AppUi' undeclared (first use this function) HeySymbianContainerView.cpp /HeySymbian/src line 177 C/C++ Problem
    1296839578442 cannot call member function `virtual void CAknView::HandleStatusPaneSizeChange()' without object HeySymbianContainerView.cpp /HeySymbian/src line 190 C/C++ Problem
    1296839578443 `AppUi' undeclared (first use this function) HeySymbianContainerView.cpp /HeySymbian/src line 194 C/C++ Problem
    1296839578444 `StatusPane' undeclared (first use this function) HeySymbianContainerView.cpp /HeySymbian/src line 212 C/C++ Problem
    1296839578445 `ClientRect' undeclared (first use this function) HeySymbianContainerView.cpp /HeySymbian/src line 253 C/C++ Problem
    1296839578446 no matching function for call to `CHeySymbianAppUi::AddViewL(CHeySymbianContainerView*&)' HeySymbianAppUi.cpp /HeySymbian/src line 50 C/C++ Problem
    1296839578447 no matching function for call to `CHeySymbianAppUi::SetDefaultViewL(CHeySymbianContainerView&)' HeySymbianAppUi.cpp /HeySymbian/src line 51 C/C++ Problem
    1296839578436 expected class-name before '{' token HeySymbianContainerView.h /HeySymbian/inc line 35 C/C++ Problem

  15. #15
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,572

    Re: Integrate HTTPClientExample project with HelloWorld Application

    Those methods are available in CAknView, not CCoeControl.

Similar Threads

  1. «Certificate Error Contact the Application supplier» on HelloWorld C++ Project in E6
    By ysaspb in forum Symbian Signed Support, Application Packaging and Distribution and Security
    Replies: 10
    Last Post: 2010-04-29, 09:18
  2. Replies: 5
    Last Post: 2009-10-07, 17:50
  3. HelloWorld project - problems
    By AliceC in forum Symbian
    Replies: 3
    Last Post: 2009-09-23, 14:03
  4. i cant build helloworld project
    By akhin in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 2
    Last Post: 2008-12-22, 12:38
  5. Compiling helloworld-project for Nokia6600 with Series60 SKD v2
    By Phryneas in forum Symbian Tools & SDKs
    Replies: 1
    Last Post: 2005-05-22, 18:00

Posting Permissions

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