MapInfo Pro

 View Only
  • 1.  Call Custom Cursor From a Dll

    Posted 09-08-2021 02:55
    Hi,

    I have created a custom cursor named OSM-Cursor.cur it's stored within the Images folder in my dll, how do i use it in the RBNControlsetMICursorIdx() statement for use my application?
    Sub Main
    
    Dim nCtrlIdx As Integer
    
     '// Adding the TAB named Property with the caption of Property
     nCtrlIdx = RBNAddTab("TabProperty", "Property", "")
        
     '// Adding the Group named Web Maps to TabProperty
    nCtrlIdx = RBNTabAddGroup("GroupWebMaps", "Web Maps", "TabProperty")
    
    If NOT nCtrlIdx > 0 Then
     Exit Sub
    End If
    
    If nCtrlIdx > 0 Then
    nCtrlIdx = RBNGroupAddControl("OSMButton", "Open Street Maps", "", ControlType_ToolButton, "TabProperty", "GroupWebMaps")
    Call RBNControlSetToolTipIdx(nCtrlIdx, "View Open Street Maps", "View Open Street Maps at selected location on the map", "A mapper must be active to use this button")
    Call RBNControlSetIconsIdx(nCtrlIdx, CONTROL_SIZE_LARGE, "", "pack://addinorigin:,,,/" + DLL_PATH + "MI_Ribbon_Icons.dll;component/Images/OpenStreetMap_32x32.png")
    'Call RBNControlSetCustomMBXHandlerIdx(nCtrlIdx, "OpenStreetView")
    Call RBNControlsetMICursorIdx(nCtrlIdx, MI_CURSOR_LRG_CROSSHAIR, "")
    
    End If
    End Sub​
    Regards
    Andrew

    ------------------------------
    Andrew Niebling
    Queensland Rail Ltd
    Brisbane QLD
    ------------------------------


  • 2.  RE: Call Custom Cursor From a Dll

    Employee
    Posted 09-08-2021 07:22
    Hi Andrew

    I don't think I have ever used a cursor from a single cur file. I have always compiled them into a DLL.

    You can try to specify 0 or 1 for the nCursor parameter and the name of your .cur file for the sFile parameter.

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



  • 3.  RE: Call Custom Cursor From a Dll

    Posted 09-08-2021 07:32
    Hi Peter,

    Yes, my cursor is compiled into a dll file, i added it to the Images folder within the dll. How should i reference it from within the dll?

    Regards
    Andrew

    ------------------------------
    Andrew Niebling
    Queensland Rail Ltd
    Brisbane QLD
    ------------------------------



  • 4.  RE: Call Custom Cursor From a Dll

    Employee
    Posted 09-08-2021 08:07
    Your cursor should be compiled into the DLL with a number which is what you would refer to it with.

    Been a while since I did this, but I think I compiled it into the DLL as a cursor, not as an image. I may be wrong here though.

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



  • 5.  RE: Call Custom Cursor From a Dll

    Posted 09-09-2021 10:42
    I created a folder called cursor in my dll, added the cursors and rebuilt it, but i'm not sure how i assign a number to each cursor?


    ------------------------------
    Andrew Niebling
    Queensland Rail Ltd
    Brisbane QLD
    ------------------------------