// JP opened flex table

Click to See Complete Forum and Search --> : Visual Studio/Office 97 style Dockable Menu bar BUG..


The Mad Butcher
May 1st, 1998, 07:55 AM
I had the problem with the toolbar class that if i moved a toolbar, the old

window still remained on screen. This was because the old window never was

removed after a move.. Which only could mean that the WM_WINDOWPOSCHANGING message was not handled (correctly). After retrieving the latest version of the source (Toolbar_105.zip) and some searching I found that there was a function implemented for handling the WM_WINDOWPOSCHANGING message, but the message was never handled by MFC.. Then i looked at the message map for MFC in NGenericToolBar.cpp and... My thoughts where right.. The message was not handled by MFC 'cause it was not in the message map!


Here is how to fix it..


In the file NGenericToolBar.cpp, near line 35 the message map is declared.

Here there is something forgotten (! The WM_WINDOWPOSCHANGING is NOT handled !)


This the message mas as it should be:

BEGIN_MESSAGE_MAP(CNGenericToolBar,CToolBar)

//{{AFX_MSG_MAP(CNGenericToolBar)

ON_WM_CONTEXTMENU()

ON_WM_DESTROY()

ON_WM_PAINT()

ON_WM_NCCALCSIZE()

ON_WM_NCPAINT()

ON_WM_NCHITTEST()

ON_WM_WINDOWPOSCHANGING() // TMB! This one is realy needed but wasn't there!

//}}AFX_MSG_MAP

ON_COMMAND(IDM_BUTTONSONLY,OnButtonsOnly)

ON_COMMAND(IDM_BUTTONSANDTEXT,OnTextAndButtons)

ON_COMMAND(IDM_TEXTONLY,OnTextOnly)

ON_COMMAND(IDM_RECALCSIZE,OnRecalcSize)

END_MESSAGE_MAP()


Greetings,

Albert 'The Mad Butcher' van Peppen

Tony Hoyle
May 29th, 1998, 11:43 AM
Thanks for the fix - I've put it into the latest version (1.053). I

must admit I'd not noticed any updating problems, though.


Tony


My home page with latest version

//JP added flex table