MapInfo Pro Developers User Group

 View Only
  • 1.  calling mapbasic code from custom menu

    Posted 02-05-2021 09:55
    Hi,
    Can you help me with making a call to mapbasic code from a .net created context menu? I have been looking at the CustomizeMapMiniToolbar sample, which I've now referenced from my existing mapbasic app. I've been able to modify the context menu to add my own buttons, and have no problem in calling MIPro commands such as 101 M_FILE_NEW. What I've not been able to do is to make it call any of my own exiting mapinfo subs.  I've tried
    addValidationButton.CommandId = 5800;
    where 5800 is the ID assigned to the menu by my legacy mapbasic code.

    I've also tried implementing a delegatecommand but this does not appear to fire.
    Thanks

    ------------------------------
    Paul Brignall
    DRILLING INFORMATION LTD
    GLOS
    ------------------------------


  • 2.  RE: calling mapbasic code from custom menu

    Employee
    Posted 02-09-2021 05:30
    Hi Paul

    Have you used the CallingHandler property to set the MapBasic Sub to call?

    ------------------------------
    Peter Horsbøll Møller
    Principal Presales Consultant | Distinguished Engineer
    Precisely | Trust in Data
    ------------------------------



  • 3.  RE: calling mapbasic code from custom menu

    Posted 02-12-2021 12:25
    Hi Peter,

    I have done so now and got the result I was expecting. Where can I find documentation on these properties?
    Thanks, Paul

    ------------------------------
    Paul Brignall
    DRILLING INFORMATION LTD
    GLOS
    ------------------------------



  • 4.  RE: calling mapbasic code from custom menu

    Employee
    Posted 02-15-2021 13:48
    Hi

    Use the ExtensibilityReferenceHelp.exe in the MapBasic installation folder

    ------------------------------
    Peter Horsbøll Møller
    Principal Presales Consultant | Distinguished Engineer
    Precisely | Trust in Data
    ------------------------------