Can't add item to plugin menu



  • Hello, I’m trying to build a plugin for notepad++ then I downloaded the template sample code.
    I’ve added that line from the plugin demo :

        setCommand(DOCKABLE_DEMO_INDEX, TEXT("Dockable Dialog Demo"), DockableDlgDemo, NULL, false);
    

    With the appropriate function definition, but that doesn’t add an item to the menu. Is there somewhere else I need to add something ?

    Thanks



  • Is there somewhere else I need to add something ?

    Well depends what you really did.
    Did you modify the int pointer parameter of the getFuncsArray method?



  • No, and I don’t see this function used anywhere…



  • Sorry I just see the step 2 (DEFINE YOUR PLUGIN COMMAND NUMBER), it works after setting a greater number.



  • @Gregory-D said in Can't add item to plugin menu:

    I don’t see this function used anywhere

    Are you sure you know what you are doing? I mean, conceptually?

    It’s one of the things Notepad++ itself uses, to interact with a plugin, so you would see that function used it ITS source code, not somewhere else in the plugin’s code.

    The line of code that @Ekopalypse pointed you to is a big clue, what with the "export"ing.



  • @Alan-Kilborn said in Can't add item to plugin menu:

    It’s one of the things Notepad++ itself uses, to interact with a plugin, so you would see that function used it ITS source code, not somewhere else in the plugin’s code.

    not sure I understand this

    It’s one of the things Notepad++ itself uses, to interact with a plugin,

    correct

    so you would see that function used it ITS source code, not somewhere else in the plugin’s code.

    that is the part I don’t understand.
    Plugins do need to export the functions I pointed to, hence those functions are part of the plugin code.
    Without having it in the plugin code there wouldn’t be available for npp to call them.

    Is that what you meant too?



  • @Ekopalypse

    What I meant, I said badly.

    “it ITS” should have been “in ITS” for one thing.

    I thought (maybe wrongly) that the OP didn’t see an exported function from the plugin DLL called anywhere by other code (within the plugin), so they thought it was unused.


Log in to reply