The MFC tip of zafir Anjum on how to select an entire row works only,as describe, with CListCtrl derived classes.I found a astonishing sample in MSDEV Samples book which allow to useonly (!!) a CListView derived class (called CListViewEx) to do so,without any CListCtrl-derived class (or just in orde...
I have created an MDI project and incorporated the classes supplied in the article "Visual Studio/Office 97 style Flat Toolbar and Dockable Menu bar" and the main menu does not appear. The popup menues are accessable via the keyboard shortcuts but the menu is gone. I believe I have made all the pr...
Hi,please help me - I need some kind of fix to this problem.I have taken TransparentBlt source from this site; it works like charm when blitting to the display; however blitting to a printer (HP LJ 4, Postscript) does not work; the parts that should be transparent are printed out black instead!What...
I am using CSizingTabCtrlBar from Dirk Clemens. first I click on the treeview, and then double click to make the bar floating or drag it to make it floating, click on the x button to close the window, the application window stops responding to mouse clicks. when the application close, get GPF. Is an...
152 byte By
Subrosa at 2007-11-15 22:05:12
The author of CStringEX should run Purify(memory checker) on CStringEx. It particularly complains about writing out of bounds in the Delete() function.
249 byte By
Cagan at 2007-11-15 22:05:13
For a report-style CListCtrl, I use SetItemData() method to store some values, when I use GetItemData() I get 0 (zero) especially for the first item in the control whereas the real value has nothing to do with it.<br/>Any ideas?<br/>Thanks
Hi,I went on testing TransparentBlt code from this site and I have found something quite strange:If the source bitmap going to TransparentBlt function is a DIBSection, the result is funny. It seems that the blt of source DC and mask DC (that one with SRCAND ROP) fucks up the colors of the DIBsection...
266 byte By
Martin at 2007-11-15 22:05:15
List column headings - When you double click the heading resize cursor the column auto resizes to the width of longest data item. However this doesn't work properly if any of the data item are in Bold type. Any ideas?<br/>Thanks in advance.<br/>Martin
148 byte By
M.Ezhil at 2007-11-15 22:05:16
In "Owner Drawn Menu with Icon",how to derive a class from CMenu.<br/>I was not able to create using ClassWizard.Should i create my own class?.
90 byte By
lee at 2007-11-15 22:05:17
TBN_HOTITEMCHANGE, TBDDRET_DEFAULT, LPNMTBHOTITEM : undeclared identifier<br/>Thanks.
I have found that the CCoolMenuManager class leaks memory in an application with a standard MFC MRU on the "File" menu. The "ConvertMenu" function continually allocates memory at the "pmd = new CMyItemData;" statement for the MRU items in the list everytime the menu drops down.My guess is that when...
Hi,after testing Zafir's code for resizing property pages, I came to this conclusion: For new versions of comctl32.dll it works like charm. However, for outdated versions of comctl32.dll (the one which is distributed with original Win95 installation - or the one which is distributed with Win32s...
194 byte By
Alan at 2007-11-15 22:05:20
The propertysheet's member CTabControl seems not to support TCS_BOTTOM.<br/>The tab is on the top.<br/>What's wrong? Or I must update any files?<br/>Thanks<br/>Alan
BUG in MFC's support for print preview =======================================We have created SDI application with support for print & printpreview, we are facing the following problem.When the print preview mode is invoked, set the focus on the close button on the dialog bar. Now press the spa...
214 byte By
Leow at 2007-11-15 22:05:22
The CJCombo::SetCurSel(int) seems to have a bug in it.<br/>I have a 2-column combo, when i do<br/>for (i= 0, i SetCurSel(i);<br/>some of the text in the 2nd column wasn't display.<br/>leow
583 byte By
Mirko at 2007-11-15 22:05:23
Hi to All!We have problem concerning operator new in MFC application: If we use it in the main thread it correctly throws exception CMemoryException (if not enough mem available). But if we use it in a secondary thread, it simply returns zero.The second thread will be created inside a MFC DLL. When...
I experienced two little problems with the CFlatToolBar code when positioning vertically the toolbar. - the toolbar does not seem to take account of the separator width - the position of the first button next to the grip is incorrect when you moce the toolbar in the following position consecut...
194 byte By
Craig at 2007-11-15 22:05:25
The listctrl sorting algo on this site seems to only move the text around, not the entire LV_ITEM. This is very noticable when you are using the lParam for each item. Is it possible to fix this?
In MFC print preview the scroll bar allows you to easily scroll through the pages to be printed. If you zoom in on part of the displayed page the scrollbars change to allow you to scroll the zoomed area around the page.When you zoom out again the scroll bars do not return to their former state. Yo...
1325 byte By
Udo Liess at 2007-11-15 22:05:27
Some days ago I posted a note about a problem with CListCtrl. But no reactions. Now I found out a little bit more about it.Here is the BUG:(I use WinNT 4.0, VC5)Create a MFC application as dialog based (MainDialog).Create a dialog resource (ChildDialog).Set dialog style to CHILD.Place a list control...
The function CSplitterWnd::OnMouseWheel asserts if _any_ pane in the splitteris not handled by a CScrollView-derived class. This looks like a bug to me;CSplitterWnd is meant to handle any CView class. Also, CScrollView itself assumes that if it is part of a splitter, then the splitter will handle t...
151 byte By
Ronan at 2007-11-15 22:05:29
I have followed the sample on creating an ownerdrawn CListCtrl but DrawItem is never called, lots of people on usenet have the same problem, any Ideas?
I downloaded the sample project using the ComboBox in the MFC Grid Control. When I try to unzip it, Winzip gives the message "Cannot open file: does not appear to be a valid archive".<br/>Thanks
If you want to have the ON_UPDATE_CMD_UI called, just do the two following things :1. Derive you toolbar from CToolBar, to add the hanfdler for WM_IDLEUPDATECMDUI (as shown in MFC code for CFrameWnd) but, before calling the parent's function, cast the this pointer to CFrameWnd*,2. Override the...
The code for the flat owner drawn buttons does not work properly when using a bitmap. When the bitmap button is in a disabled state, no draw action isundertaken at all. A quick solution to this is to move the actual draw code contained in DrawItem (i.e. the else part of the if(!hBitmap)), and put it...
468 byte By
Vytukas at 2007-11-15 22:05:33
I took src from dev-archive with owner draw list. Decided to add drag and drop feature and noticed that CreateDragImage() doesnt create correct image (Im getting empty image) if no image list attached to control. If there is image list CreateDragImage() creates only bitmap part and no text label pa...
I took src from dev-archive with resizable docking window by Mark Conway. Decided to add items to the fake DevStudio style Workspace window and notice that, if I expand a branch that contains strings not completely visible (because of the sizable window right margin), then select the string and try...
The article on this link http://www.dev-archive.com/toolbar/ctrls_in_tb.shtmlis incomplete. It cuts off right on the code that explains how to add checkboxes to the tool bar. If any one has sample code that does this, please passalong to my email address.thanks,Scott...
When delete row(rows) or col(cols) , there has memory leaks.<br/>The row and col cell object should be delete at first and then update<br/>the m_nRows and m_nCols.
I have found a little bug in CLongOperation class created by Klaus Gutter. When CLongOperation class is created, text in StatusBar's panes is moved to the left and text in left most pane is lost, till CLongOperation class exists.I have made this changes to fix tis problem in Visual C++ 5.0:1. i...
707 byte By
Eric Hu at 2007-11-15 22:05:38
>>There are several bugs and omissions on the code I send to the MFC Programmer's Sourcebook. When> you try to compile any code that uses these classes you get a few errors. Some are my fault, some not. I >have already send an updated version of the code to zafir, but as far as I kn...
I have come across two small draw bugs with this otherwise excellent class:1. If a menu item is a pop-up menu, then the space to the left of the text is different to the space for non-popup menu items.2. I seem to have an eratic display of checks...some of my apps are fine...some of them do not disp...
The triangular button demo by Janus Kjempff has an NT-only API that results in the code not working on Windows 95:In CTriangleButton::DrawItem() a pen is created like this:CPen FocusPen(PS_COSMETIC | PS_ALTERNATE, 1, &logbrush);According to the documentation for ExtCreatePen(), PS_ALTERNATE is not s...
Hi,in adition to recent fix found here, I have found a few more bugs with row highlighting (and editable subitems) and I could fix only some of them.1. (NOT FIXED) In HIGHLIGHT_ALLCOLUMNS mode, after manual adjusting the column widths, the contents of listview becomes messy. It seems the whole contr...
I could not get pop-up menus to work (none were displayed in main menubar).<br/>Any comments?<br/>Thanks.<br/>Igor
I have noticed a small problem with the 3D display of disabled accelerator keys. The 3D look of the text after the tab (accelerator key) has a wrong offset.This can be easily fixed by adding one line of code to the DrawItem function (see below).bool CMenuSpawn::DrawItem(LPDRAWITEMSTRUCT lp){...........
552 byte By
Sascha at 2007-11-15 22:05:44
Problem : Using the sample "Open File with Bitmap Preview" causes repaints of the whole desktop all the times. Fix : I fixed it with adding the follwing line :#define IDC_BMP (5001)and by replacing the follwing two lines case WM_NOTIFY : ... HWND wnd = GetDlgItem(hdlg, IDC_PREVIEW);...
Hello there,I have downloaded the library earlier today (28th January 99) and I am using Microsoft Visual C++ 5.0 with the latest platform SDK as suggested but I get a fatal error from KERNEL32.LIB LNK1106 invalid file or disk full...My KERNEL32.LIB is 181,876 bytes dated 8/8/98Any one can help me w...
Hi Chris and everyone,Hope this one doesn't qualify as off topic ;) I found a bug, or what I think is a bug, in atlhost.h in the AtlAxWindowProc function. In response to the WM_CREATE message, the dialogbox (derived from CAxDialogImpl) will be created with it's controls. Now, as long as th...
I used HTML help in a property page of a modeless property sheet. When closing the application, a GPF occurs (read in memory 0x0000000). When not clicking on the help page (ie OnInitDialog is not called), everything wents OK. What goes wrong in my project?
714 byte By
Bozo at 2007-11-15 22:05:48
When using the precompiled DLL file and sample,I get 2 bad behaviours:1)MenuThe menu DOES NOT APPEAR AT ALL if the window is NOT maximized !That means the menu appears (and works well) only if the windowis maximized.2)ToolbarThe toolbar works in all cases, but: a)When you customize the toolbar and t...
If you try the example given where the string is "(415) 555-7777", and you call GetDelimitedField("(", ")", 0 ), the method should return "415". However, all I ever got was "". There is a fix. Change the line which reads:lpszRemainder = lpsz + lenDelimEnd;tolpszRemainder = lpszEnd + lenDelimEnd;...
In using the CListCtrl enchanements from this site, I have found that 'Highlighting A Row' and 'Editable Subitems' are not compatiable.Problem:In CMyListCtrl::SetOnFocus(CWnd *pOldWnd){if (pOldWnd != NULL && pOldWnd->GetParent() == this)return;//more...}The GetParent() call pr...
Markus Fischer sent me this code that fixes problems with the RFX_OleDateTime code I sent in:void AFXAPI AfxStoreFieldCOleDateTime(CRecordset& rs, UINT nField, COleDateTime& value){ // Get the field data CFieldInfo* pInfo = &rs.m_rgFieldInfos[nField - 1]; // Cache the status pInfo->m_bStatus = rs...
This is the code for one of the functions used in the article.int CMyListCtrl::GetRowColumnIndex(CPoint& point, int*col) const{ int colnum = 0; int row = HitTest( point, NULL ); if( col ) *col = 0; // Make sure that the ListView is in LVS_REPORT if( (GetWindowLong(m_hWnd, GWL_STYLE) & LVS_TYPEM...
Problem:This was causing a crash in my ANSI Release build with normal optimizations due to the 'this' pointer for this windowclass being hosed by RegQueryValueEx. Without optimizations turned off it simply overwrote cbDragfullWindows.Fix:I changed the following to set cbDragfullWindows to...
I'm trying to use ShowHideMenuCtl common controls function and it doesn't work.<br/>I've read SDK docs but I'm a little confused.<br/>Anybody know how and when to use this function (some sample code appreciated).<br/>Thanks for advance,<br/>Romain.
Correction to "Autosize a column to fit its content - Roger Onslow"I modified the source to work from a CListView rather than a Ctrl. However we had an annoying flicker that I traced to SetColumnWidth(). SetRedraw(false) did not suffice (this is very apparent with a non-white background, you can se...
I had the problem with the toolbar class that if i moved a toolbar, the oldwindow still remained on screen. This was because the old window never wasremoved after a move.. Which only could mean that the WM_WINDOWPOSCHANGING message was not handled (correctly). After retrieving the latest version of...
Not a really fatal bug, but it took me a minute or two to figure out..<br/>If you try to delete a comment, and enter you password and hit ENTER as opposed to clicking on the Delete button, it takes you to the Add Comment page instead of deleting your comment.<br/>Ryan