I now have an unwanted, disabled button on my program's toolbar that has an image that appears to be a ghost (disabled copy) of the first button's icon. The toolbar behaves normally, otherwise. All my attempts to remove or account for the button have failed. The attached image shows the program behavior at the top, the toolbar editor in the middle and the properties for the "next" icon at the bottom.
The development environment is Visual C++ 2017 (15.9.21). The program was originally developed under VS 6.0 and spent many years in VS 2005. However, the problem does not relate to the VS 2017 upgrade. That was accomplished two years ago.
Note that I don't have much experience with direct editing in the *.rc file, but I'm willing to have a go at that with proper guidance.
I now have an unwanted, disabled button on my program's toolbar that has an image that appears to be a ghost (disabled copy) of the first button's icon. The toolbar behaves normally, otherwise. All my attempts to remove or account for the button have failed. The attached image shows the program behavior at the top, the toolbar editor in the middle and the properties for the "next" icon at the bottom.
The development environment is Visual C++ 2017 (15.9.21). The program was originally developed under VS 6.0 and spent many years in VS 2005. However, the problem does not relate to the VS 2017 upgrade. That was accomplished two years ago.
Note that I don't have much experience with direct editing in the *.rc file, but I'm willing to have a go at that with proper guidance.
Thanks for any insight and/or assistance.
FF
It's probably in your MainFrm.cpp code. Look for an array called nButtons, and a call to m_wndToolBar.SetButtons(). If you don't see anything there, look for anything in MainFrm.cpp that has to to with initializing the toolbar.
Thanks for the suggestions. I am actually using a third-party library - Rogue Wave Stingray - to handle my windows. I pass a 0 count into the toolbar loading function. The library assigns the number of buttons - 17 - apparently when the toolbar is loaded. This is the correct number for the intended display if separators are included in the count. The actual display shows an additional separator and an additional button.
I will continue to tilt at this starting next Monday. For now it's time for a holiday weekend.
This has gotten even stranger to me. The Toolbar Editor and *.rc files seem to have no effect whatsoever on the toolbar.
I added a resource ID to the "next" button and did a quick icon. I added the resource to one of the program menus and added handlers. The second attached image ("Unwanted Toolbar Button 2") shows that the resource appears correctly in the menu when the resource is both enabled and disabled. The menu entry also properly calls the handler. However, the image shows that the toolbar remains unchanged.
In the third attached image I show that the toolbar design differs completely from the program behavior. I have moved the new resource to fourth from the left. I did this by directly editing the *.rc file as shown. The *.rc changes appear in the Toolbar Editor, but not in the executing toolbar. Furthermore, the separators are misplaced in the executing toolbar and, apparently have been for some time.
Even if there is some sort of bug in the Toolbar Editor, it seems to me that direct editing in the *.rc file should compile and display any changes.
As I said earlier, the problem isn't likely in the resource file, it's where the toolbar is getting created. If you're using MFC, lookin in Mainfrm.cpp. If you're not, look into whatever framework is actually creating the toolbar.
I seem to have corrected this problem locally by using the customize dialog to adjust the toolbar within the program. This is persistent. If the adjusted arrangement appears in the distributed program, the problem resolved, even if not programmatically.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.