|
Is it possible?
------- signature starts
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
"You won't like me when I'm angry..." - Dr. Bruce Banner
Please review the Legal Disclaimer in my bio.
------- signature ends
|
|
|
|
|
I tried it once but was unsuccessful. I created two classes: one from CListCtrl and the other from CListView. Maybe if I had dinked around with it for a few more hours, I could have made it work.
|
|
|
|
|
Just guessing, but since both inherit from CWnd, there are going to be some messages that will be sent to you twice and one is for the CListView and the other is for the CListCtrl. Not too sure if you will be able to differentiate what has to be done.
If you don't mind me asking, what might you be trying to accomplish?
Chris Meech
"what makes CP different is the people and sense of community, things people will only discover if they join up and join in." Christian Graus Nov 14, 2002.
"And when you need to hire a programmer to do mostly VB programming, it's not good enough to hire a VB programmer, because they will get completely stuck in tar every time the VB abstraction leaks." Joel on Software Nov 11, 2002.
|
|
|
|
|
It's a CE SDI app that displays multiple views. Two of the views are not associated with the doc, and they both contain a list control (derived from CListCtrl), but the views are not derived from CListView. I'm having problems getting the list control to show up in the view.
Most of the code is being ported from a desktop (MDI) version of the same app.
------- signature starts
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
"You won't like me when I'm angry..." - Dr. Bruce Banner
Please review the Legal Disclaimer in my bio.
------- signature ends
|
|
|
|
|
Here's a suggestion, but I have no familiarity with MFC on the CE development platform. Could each of the views be dialog based and the CListCtrl members of the dialogs?
Chris Meech
"what makes CP different is the people and sense of community, things people will only discover if they join up and join in." Christian Graus Nov 14, 2002.
"And when you need to hire a programmer to do mostly VB programming, it's not good enough to hire a VB programmer, because they will get completely stuck in tar every time the VB abstraction leaks." Joel on Software Nov 11, 2002.
|
|
|
|
|
I was trying to avoid that, but it would probably work.
------- signature starts
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
"You won't like me when I'm angry..." - Dr. Bruce Banner
Please review the Legal Disclaimer in my bio.
------- signature ends
|
|
|
|
|
Wouldn't that defaut the purpose of using a CListView? Keeping in mind that both classes are encapsulations of the Windows SysListView32 window class with the main difference being that the CListView has ties to the doc/view architecture, I would think that you would be losing what you're going after by simply using a CListCtrl on a dialog.
Cheers,
Tom Archer
Inside C#, Extending MFC Applications with the .NET Framework
It's better to listen to others than to speak, because I already know what I'm going to say anyway. - friend of Jörgen Sigvardsson
|
|
|
|
|
I don't need the doc/view interface for this view. It simply shows a list of files in a specific folder.
------- signature starts
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
"You won't like me when I'm angry..." - Dr. Bruce Banner
Please review the Legal Disclaimer in my bio.
------- signature ends
|
|
|
|
|
I'm confused here. The list view *is* the list control. A common misconception is that the list view contains an embedded list control. It doesn't. Both are CWnd that encapsulate the SysListView32 window. When you say the listview doesn't show up, what exactly are you seeing. Are you sure your view is in the correct mode (e.g., LVS_REPORT)?
Cheers,
Tom Archer
Inside C#, Extending MFC Applications with the .NET Framework
It's better to listen to others than to speak, because I already know what I'm going to say anyway. - friend of Jörgen Sigvardsson
|
|
|
|
|
I'm seeing an empty view. The listctrl is set to report mode, but i don't see the list control header.
------- signature starts
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
"You won't like me when I'm angry..." - Dr. Bruce Banner
Please review the Legal Disclaimer in my bio.
------- signature ends
|
|
|
|
|
I gotta tell you. The only things I can think of are the basics like did you insert the column headers (InsertColumn) and such. Other than that, I've never heard of such a problem. Also, are you setting the report view in the view's PreCreateWindow?
Cheers,
Tom Archer
Inside C#, Extending MFC Applications with the .NET Framework
It's better to listen to others than to speak, because I already know what I'm going to say anyway. - friend of Jörgen Sigvardsson
|
|
|
|
|
I think I need to start this again. The desktop app (legacy code, not coded by me) does this:
A CView-derived class that contains a data member that is defines as follows:
protected:<br />
CMyListCtrl< CDataObject > myListCtrl;<br />
A CListCtrl-derived class implemented like so:
<br />
template < class T > class CMyListCtrl : public CListCtrl<br />
{<br />
blah blah blah<br />
};<br />
The list control class cannot be changed because it's used in several other places (other views and dialogs as well).
I am probably mistaken, but this arrangement doesn't appear to me to be usable as far as deriving new view classes. Would it be valid to do this:
typedef CMyListCtrl< CDataObject > CMyDataObjectListCtrl;<br />
and then use the new typedef as a basis for using your CCtrlView article (cited by someone else)?
<br />
CMyListView::CMyListView():CCtrlView(_T("MYLISTCTRL"), AFX_WS_DEFAULT_VIEW) { };<br />
<br />
CMyDataObjectListCtrl& CMyListView::GetListBox() const <br />
{ return *(CMyDataObjectListCtrl*)this; }<br />
------- signature starts
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
"You won't like me when I'm angry..." - Dr. Bruce Banner
Please review the Legal Disclaimer in my bio.
------- signature ends
|
|
|
|
|
No promises, but I'm seeing if I can get my demo to work with a derived CListCtrl class right now.
Cheers,
Tom Archer
Inside C#, Extending MFC Applications with the .NET Framework
It's better to listen to others than to speak, because I already know what I'm going to say anyway. - friend of Jörgen Sigvardsson
|
|
|
|
|
Just in case you didn't know, the demo project is no longer available from the developer.com web site article.
------- signature starts
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
"You won't like me when I'm angry..." - Dr. Bruce Banner
Please review the Legal Disclaimer in my bio.
------- signature ends
|
|
|
|
|
I don't think it's what you're looking for anyway. My article's intention is to illustrate how to create a CCtrlView-derived class that uses any Windows class. It's not intended to use an already-coded derived CWnd class. I'm seeing what I can do with it, but I might have to revert to Zafir's kludge.
Cheers,
Tom Archer
Inside C#, Extending MFC Applications with the .NET Framework
It's better to listen to others than to speak, because I already know what I'm going to say anyway. - friend of Jörgen Sigvardsson
|
|
|
|
|
Tom Archer wrote:
Zafir's kludge
That sounds like some obscure mathematical theorem...
------- signature starts
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
"You won't like me when I'm angry..." - Dr. Bruce Banner
Please review the Legal Disclaimer in my bio.
------- signature ends
|
|
|
|
|
I'm in the middle of negotiating with a new client, but I'll work on this as time permits.
Cheers,
Tom Archer
Inside C#, Extending MFC Applications with the .NET Framework
It's better to listen to others than to speak, because I already know what I'm going to say anyway. - friend of Jörgen Sigvardsson
|
|
|
|
|
Zafir did something similiar years ago with the CTreeCtrl and CTreeView. Check out CodeGuru. It's not 100% the same, but I did get his to work at one point when working with listview/listctrl so I know it can be done.
Sorry to not be more specific. But it's definitely not trivial and at least will point you in the right direction.
Cheers,
Tom Archer
Inside C#, Extending MFC Applications with the .NET Framework
It's better to listen to others than to speak, because I already know what I'm going to say anyway. - friend of Jörgen Sigvardsson
|
|
|
|
|
Tom Archer wrote:
Zafir did something similiar years ago with the CTreeCtrl and CTreeView.
Ok Tom, I know this is off the subject here, but does anyone know what happened to Zafir? What is he doing now?
-Nick Parker
|
|
|
|
|
|
Tom Archer wrote:
FWIK, he took his millions and went back to India.
Pretty much disappeared from the Internet altogether huh? I guess I find that a little odd when it looks like he initially contributed so much, not to say others didn't.
-Nick Parker
|
|
|
|
|
I know what you mean, but everyone is different. Obviously the main thing he cared about was the $$. Out of the millions he made on the site, Maunder and I asked that he give a small amount to the various section heads. We're talking maybe 10k here - not something unreasonable for the peopl that made him rich. He never even responded and eventually just disappeared.
Cheers,
Tom Archer
Inside C#, Extending MFC Applications with the .NET Framework
It's better to listen to others than to speak, because I already know what I'm going to say anyway. - friend of Jörgen Sigvardsson
|
|
|
|
|
|
|
This is the only way I've been able to use a derived CListCtrl with a view in the past. However, I just tried to use it and it 1) doesn't compile without some tweaks and 2) asserts all over the place.
http://www.codeguru.com/listview/ctrl_vs_view_undoc.shtml[^]
I'm thinking your only choice is something very manual, where you use a FormView, subclass the list control with your derived class and then manually handle sizing issues.
Cheers,
Tom Archer
Inside C#, Extending MFC Applications with the .NET Framework
It's better to listen to others than to speak, because I already know what I'm going to say anyway. - friend of Jörgen Sigvardsson
|
|
|
|