ASSERT in ABPOPUP error: Mimiced control must be a button or a menu item

I am getting an error when I open a new window, it just started happening and I am not sure why. The window is one of the main windows I use in my application. The error is as follows:

ASSERT Window
Assertion failed in [ABPOPUP.CLW] @[512]
Mimiced control must be a button or a menu item
Continue - Halt

Clicking on the Continue button the window opens up just fine and all works as it should. The window is typically called from a Noyantis Task panel, but I called it from the Main procedure menu and I got the same error

If you have any calls to Popup.AddItemMimic, make sure the passed control FEQ represents a button or menu item.

1 Like

If you run under the Debugger the Assert Dialog should offer a Debug Break button to step into the running source code. Step Source until you leave ABPopup and get back to the calling code that will be the problem line.

Carl,

Thanks for the reply, I ran the debugging and did the step source as suggested but I didn’t get the results as you indicated.

The only thing that I did to my app was to update all of my Capesoft extensions. I will reach out to Bruce to see if he knows of any possible issues.

Here is a picture of the error (now that I figued out how to post pictures.)

Assert Error

As Jeff said open the Embeditor on that Procedure to see all the generated code. Search for “AddItemMimic”. The 2nd parameter of that call must be a BUTTON or Menu ITEM.

Below is the code from ABWINDOW.CLW with the ASSERT at line 512 checking for BUTTON or ITEM.

This is what I get when I do a search for AddItemMimic

! Prepare Alert Keys
SELF.SetAlerts()
NetLocalRefreshDate = today() ! NetTalk (NetRefresh)
NetLocalRefreshTime = clock()
BRW36.Popup.AddItem(‘-’,‘xSeparator1’)
BRW36.Popup.AddItem(‘xSearch’,‘xSearch’)
BRW36.Popup.AddItemMimic(‘xSearch’,?xSearch:2)
BRW36.Popup.AddItem(‘xShowTagged’,‘xShowTagged’)
BRW36.Popup.AddItemMimic(‘xShowTagged’,xSearchClass:10.ShowTaggedControl)
BRW36.Popup.AddItem(‘xUnTagAll’,‘xUnTagAll’)
BRW36.Popup.AddItemMimic(‘xUnTagAll’,xSearchClass:10.UnTagAllControl)
BRW36.Popup.AddItem(‘xTagged’,‘xTagged’)
BRW36.Popup.AddItemMimic(‘xTagged’,xSearchClass:10.TaggedControl)
! [Priority 9200]

The thing is that I haven’t made any changes to these controls.

Modify ABPOPUP.CLW in line 512 to add '... Name='& Name
to the end of the Assert text then you’ll know 100% which line is the problem. You can leave that change in with no side effects.

Now:

? ASSERT(INLIST(ButtonID{PROP:Type},CREATE:Button,CREATE:Item),'Mimiced control must be a button or menu item')

New:

? ASSERT(INLIST(ButtonID{PROP:Type},CREATE:Button,CREATE:Item),'Mimiced control must be a button or menu item - Name=' & Name)

New with maximum info:

? ASSERT(INLIST(ButtonID{PROP:Type},CREATE:Button,CREATE:Item),'Mimiced control must be a button or menu item ' & |  
         '- ButtonID=' & ButtonID &', Type='& ButtonID{PROP:Type} &', Name=' & Name)

I would NOT split into 2 lines with a line continuation (|) so the file line numbers remain the same, so this:

? ASSERT(INLIST(ButtonID{PROP:Type},CREATE:Button,CREATE:Item),'Mimiced control must be a button or menu item ' & '- ButtonID=' & ButtonID &', Type='& ButtonID{PROP:Type} &', Name=' & Name)

In the IDE under File is “Open Using Redirection” where you just type ABPOPUP.CLW and it will find it in LibSrc. You should probably make a backup copy of the CLW before you modify. Once the file is open you can right-click on the Tab and select “Open Containing Folder”, then Copy the file.

Carl,

I was able to narrow it down to the Xtag extension, knowing the Browse it was attached to, I went and verified each button. The “ShowAll” button was not there. I never added it since for the purpose of this tagging it was not required. I added the “ShowAll” button and recompiled and now I no longer get the error. I am still not sure why all of a sudden it needed to see it.

Thanks for your assistance in narrowing it down.

1 Like