Ask a Question

wButtonText returns the same name for each item (CMFCMenuBar)

sschultheiss
New Member

wButtonText returns the same name for each item (CMFCMenuBar)

Hi,




I'm going to write a test for an MDI MFC application. Here I encountered the following problem:


The wButtonText property of an CMFCMenuBar always returns the same value regardless of which index I use.


 


The ClickItem method also does not work. The following error occurs:



The control item '&Ansicht' not found.

Total number of items: 3.

Items: '&Datei', '&Datei', '&Datei'.




 


Sorry for my bad English.



Stefan

3 REPLIES 3
TanyaYatskovska
SmartBear Alumni (Retired)


Hi Stefan,


 


Don't use & in the item names:


obj.ClickItem("Ansicht")

---------
Tanya Yatskovskaya
SmartBear Community and Education Manager



mb0701
Not applicable

I have a similar problem. Test Complete is returning the same caption for each of the menuBar items. Test Complete Object Spy show the wButtonText correctly for the first item but not for the others. 



I have attached a screenshot.
TanyaYatskovska
SmartBear Alumni (Retired)

Hi Mahesh,

 


Did your compile the app with debug information according to the "MFC Menu Button Support" article?


If you did, but the issue persists, I suggest that you contact our Support team to investigate this behavior in detail. If you provided a simple app where the issue is reproduced on your computer, that would be great. Thanks.


 

---------
Tanya Yatskovskaya
SmartBear Community and Education Manager



cancel
Showing results for 
Search instead for 
Did you mean: