|
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
|
|
|
|
|
how do you get the find box with the find next button to stay on top even after you've pushed the find next button, There's no pin to keep it there.
I've been wondering this for years now, thanks.
|
|
|
|
|
Do you really need it? F3 will take you to the next match.
|
|
|
|
|
i know, but I like clicking the button, not to mention F3 won't leave the box open to change the text.
|
|
|
|
|
Use the Replace box instead! For some reason, the Find Next button in this dialog doesn't close the dialog.
|
|
|
|
|
I'm trying to put text into an MFC CToolBar, and am having problems with end of my tool bar getting cut off. What's happening is that app is computing the size of the toolbar WITHOUT the text, just the width of the icons/separators, so the toolbar ends up too narrow.
I'm using Visual Studio 6.0 SP5, with IE6.0 installed on my system. Here's the code I am using:
<br />
DWORD dwExStyle = TBSTYLE_EX_DRAWDDARROWS|TBSTYLE_EX_MIXEDBUTTONS ;<br />
tbar.GetToolBarCtrl().SendMessage(TB_SETEXTENDEDSTYLE, 0, dwExStyle);<br />
<br />
int index = CommandToIndex(IDM_CALCULATE);<br />
WORD dwStyle = tbar.GetButtonStyle(index);<br />
dwStyle |= BTNS_SHOWTEXT|BTNS_AUTOSIZE; <br />
tbar.SetButtonStyle(index, dwStyle);<br />
tbar.SetButtonText(index, "Calculate");
Some info: BTNS_SHOWTEXT is NOT defined by the MFC/Win32 header files that are installed on my system. I had #define BTNS_SHOWTEXT 0x40 to get this to work. I found many references to it on MSDN, and google'd for its value. I understand it will only work on systems that have IE5.0 or better.
What I'm guessing is that the MFC CToolBar implements the CalcSize function using assumptions about IE4.0; rather than calling CToolBarCtrl::GetItemRect, its assuming the size of each icon by using its bitmap size + padding. The BTNS_SHOWTEXT option is new and the circa 1998 (IE4 was just released) MFC just doesn't know to deal with it.
Thing is, I can't find any threads or discussions on what to do in this situation. I can't find a place to download a set of Win32 headers that match the new ComCtl32.dll v5.8, or any sort of MFC patches to expore the v5.8 functionality to VC6.0
Any help would be greatly appreciate. I can't switch to VC.NET (as much as I'd love to) because my company likes to drag it's feet when it comes to upgrading development tools.
|
|
|
|
|
I wouldn't be surprised if your assessment is right, considering that MFC 6 is so old and pre-dates even IE 5.
As for getting the newest headers, download the Platform SDK (see the VC forum FAQ for details on doing this)
--Mike--
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
Latest art~!@#2rDFA#@(#*%$Rfa39f3fqwf--=
NO CARRIER
|
|
|
|
|
Michael Dunn wrote:
considering that MFC 6 is so old and pre-dates even IE 5
Do you happen to know if the MFC that ships with VC.NET has been imrpoved (updated) to expose more of the new ComCtl32 features? Maybe not this problem specifically, but how about images in CListCtrls or the new thumbnails view, etc.
Even more off-topic, is this one of the reasons everyone seems to be using WTL now a days?
|
|
|
|
|
Hi there!
I 'm writing a project that converts MSO file content int to my own language ( Vietnamese). But I don't know how to read and write to them. Is any body help me?
Thanks
Jason Chang
tmsnhien@yahoo.com
|
|
|
|
|
Each Office application exposes a COM interface. Using automation, you should be able to do what you need.
|
|
|
|