From: PARVINDER RAJPUT <m...@parvinder.co.in>
To: witty-interest@lists.sourceforge.net
Sent: Wednesday, September 21, 2011 12:11 PM
Subject: Re: [Wt-interest] root()

On Wed, Sep 21, 2011 at 11:04 AM, Matthew Sherborne
<msherbo...@gmail.com> wrote:
> line 187 needs to change from:
>
> Wt::WContainerWidget *l1 = new Wt::WContainerWidget(root());
>
> to
>
> Wt::WContainerWidget *l1 = new Wt::WContainerWidget(x.root());
Same Error bro,.............:(
if WApplication is public then why it show root() error


You need to isolate the problem in steps.

1. understand how friend functions work, for this there is no need to mix Wt 
code with your test example.

2. apply that learning to using a friend function in building Wt apps.

for the 1st point - write a simple example for your self which:
   i. has a friend function and 

   ii. you are able to invoke it and 

   iii. it compiles cleanly. 


Something like this. 

You should also have a good reference book to teach yourself these c++ 
concepts, 


#include <iostream>

using namespace std;

class friend_ex
{
public:
    int data_;
    friend_ex (int p_data)
    {
        data_ = p_data;
    }
    friend void a_friend_func(friend_ex * friend_ex_obj);
    void a_class_funct();
};

void friend_ex::a_class_funct()
{
    cout << "data_=" << data_ << endl;
}

void a_friend_func(friend_ex * friend_ex_obj)
{
    friend_ex_obj->a_class_funct();
}

int main()
{
    friend_ex a_friend_obj(12345);
    a_friend_func(&a_friend_obj);
    return 0;
}






-- 
Parvinder Rajput
website:- www.parvinder.co.in

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
witty-interest mailing list
witty-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/witty-interest
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
witty-interest mailing list
witty-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to