CListCtrl & theCtrl = GetListCtrl
-
I saw these lines in an example code. I am not clear about it.
CListVieiw::OnInitialUpdate();
CListCtrl & theCtrl = GetListCtrl();My questions are (1) Is GetListCtrl()( on the second line) a member function;Which class does it belong to? (2) what does the '&' mean at the left hand side?
-
I saw these lines in an example code. I am not clear about it.
CListVieiw::OnInitialUpdate();
CListCtrl & theCtrl = GetListCtrl();My questions are (1) Is GetListCtrl()( on the second line) a member function;Which class does it belong to? (2) what does the '&' mean at the left hand side?
cy163@hotmail.com wrote:
(1) Is GetListCtrl()( on the second line) a member function;Which class does it belong to?
See here.
cy163@hotmail.com wrote:
(2) what does the '&' mean at the left hand side?
See here.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
-
cy163@hotmail.com wrote:
(1) Is GetListCtrl()( on the second line) a member function;Which class does it belong to?
See here.
cy163@hotmail.com wrote:
(2) what does the '&' mean at the left hand side?
See here.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
Thank you DavidCrow for your reply. I wonder what exactly is the role of GetListCtrl(); generate a instance of ListCtrl? or sth else?
-
Thank you DavidCrow for your reply. I wonder what exactly is the role of GetListCtrl(); generate a instance of ListCtrl? or sth else?
cy163@hotmail.com wrote:
I wonder what exactly is the role of GetListCtrl(); generate a instance of ListCtrl? or sth else?
To get a reference to the list control associated with the view.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
-
cy163@hotmail.com wrote:
I wonder what exactly is the role of GetListCtrl(); generate a instance of ListCtrl? or sth else?
To get a reference to the list control associated with the view.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
Thanks again. However, what if there are more than one list controls associated with the view.
-
Thanks again. However, what if there are more than one list controls associated with the view.
cy163@hotmail.com wrote:
However, what if there are more than one list controls associated with the view.
Then you'd have more than one view.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
-
cy163@hotmail.com wrote:
However, what if there are more than one list controls associated with the view.
Then you'd have more than one view.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
You mean ONLY one ListCtrl can be associated with one view? If so, Why there may be more than one ListCtrl in a dialog Or, I misunderstand the view concept. I think a dialog essentially is a view.
-
You mean ONLY one ListCtrl can be associated with one view? If so, Why there may be more than one ListCtrl in a dialog Or, I misunderstand the view concept. I think a dialog essentially is a view.
cy163@hotmail.com wrote:
You mean ONLY one ListCtrl can be associated with one view?
Yes, unless the view is a
CFormView
.cy163@hotmail.com wrote:
If so, Why there may be more than one ListCtrl in a dialog
Because a dialog is not a view.
cy163@hotmail.com wrote:
Or, I misunderstand the view concept.
Perhaps. But, have no fear, there's plenty of online documentation/examples to help you out.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
-
cy163@hotmail.com wrote:
You mean ONLY one ListCtrl can be associated with one view?
Yes, unless the view is a
CFormView
.cy163@hotmail.com wrote:
If so, Why there may be more than one ListCtrl in a dialog
Because a dialog is not a view.
cy163@hotmail.com wrote:
Or, I misunderstand the view concept.
Perhaps. But, have no fear, there's plenty of online documentation/examples to help you out.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
If a view is drived from CFormView. How to distinguish between ListCtrls associated with it.
-
If a view is drived from CFormView. How to distinguish between ListCtrls associated with it.
They each have a unique control ID, and thus a separate instance of
CListCtrl
."One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
-
They each have a unique control ID, and thus a separate instance of
CListCtrl
."One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
So, for a view derived from a non CFormView, GetListCtrl is used to get the reference of the ListCtrl associated with it. for a view derived from a CFormView, how to get the references of ListCtrls associated with it. What command should be used.
-
So, for a view derived from a non CFormView, GetListCtrl is used to get the reference of the ListCtrl associated with it. for a view derived from a CFormView, how to get the references of ListCtrls associated with it. What command should be used.
cy163@hotmail.com wrote:
So, for a view derived from a non CFormView...
Specifically, a
CListView
.cy163@hotmail.com wrote:
for a view derived from a CFormView, how to get the references of ListCtrls associated with it.
Like a dialog, each control has a unique ID and its own control variable (e.g.,
CListCtrl
)."One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius