Community
    • Login

    Can't add item to plugin menu

    Scheduled Pinned Locked Moved Notepad++ & Plugin Development
    7 Posts 3 Posters 544 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Gregory D.G
      Gregory D.
      last edited by

      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

      1 Reply Last reply Reply Quote 0
      • EkopalypseE
        Ekopalypse
        last edited by

        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?

        1 Reply Last reply Reply Quote 0
        • Gregory D.G
          Gregory D.
          last edited by

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

          Alan KilbornA 1 Reply Last reply Reply Quote 0
          • Gregory D.G
            Gregory D.
            last edited by

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

            1 Reply Last reply Reply Quote 1
            • Alan KilbornA
              Alan Kilborn @Gregory D.
              last edited by

              @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.

              1 Reply Last reply Reply Quote 0
              • EkopalypseE
                Ekopalypse
                last edited by

                @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?

                Alan KilbornA 1 Reply Last reply Reply Quote 1
                • Alan KilbornA
                  Alan Kilborn @Ekopalypse
                  last edited by

                  @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.

                  1 Reply Last reply Reply Quote 1
                  • First post
                    Last post
                  The Community of users of the Notepad++ text editor.
                  Powered by NodeBB | Contributors