Community
    • Login

    Trouble compiling test plugin (ANSI error)

    Scheduled Pinned Locked Moved Notepad++ & Plugin Development
    8 Posts 5 Posters 1.0k 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.
    • CAKEbuilderC
      CAKEbuilder
      last edited by

      I’m attempting to compile and run a test plugin using Visual Studio. I opened the plugin template in VS by File -> New -> Project From Existing Code. I modified the project’s Configuration Type in Properties to .dll. The platform is set to Win32 and I’ve confirmed I’m using the x86 version of npp. When I compile the .dll and place in C:\Program Files (x86)\Notepad++\plugins\test, launching npp gives the following error:

      “This ANSI plugin is not compatible with your Unicode Notepad++.”

      Have I caused issues by opening the plugin template in VS in the way I described? I was having trouble figuring out how to import the template into VS to have it shown on the new project creation screen.

      Forgive my naivety as I’m new to using Visual Studio and am hoping to build a plugin for my personal use.

      EkopalypseE 1 Reply Last reply Reply Quote 0
      • rinku singhR
        rinku singh
        last edited by rinku singh

        @CAKEbuilder said in Trouble compiling test plugin (ANSI error):

        I opened the plugin template in VS by File -> New -> Project From Existing Code.

        are you working on c# ?
        i have VS 2012 is installed and you?

        1 Reply Last reply Reply Quote 0
        • CAKEbuilderC
          CAKEbuilder
          last edited by

          I’m using Visual Studio 2019, should I be using an older version for plugin development?

          Alan KilbornA 1 Reply Last reply Reply Quote 0
          • rinku singhR
            rinku singh
            last edited by rinku singh

            yes both NppPlugin.NET.v0.6.zip and NppPlugin.NET.v0.5.zip not works with VS 2012

            i have a source project you can modify it easy https://github.com/gurikbal/Remove_dup_lines

            and you can build it online also https://ci.appveyor.com/project/gurikbal/remove-dup-lines

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

              @CAKEbuilder said in Trouble compiling test plugin (ANSI error):

              I’m using Visual Studio 2019, should I be using an older version for plugin development?

              That version is fine; don’t be misled by bad advice.

              1 Reply Last reply Reply Quote 1
              • PeterJonesP
                PeterJones
                last edited by PeterJones

                I’ve never made a plugin, but doesn’t that error refer to forgetting to define that dummy function to indicate “I am a Unicode plugin, not an ANSI plugin”?

                I would think all the plugin templates would come with that function defined nowadays, since it’s been years since the last ANSI-only Notepad++ where that function was relevant, but maybe the OP started from an ancient template.

                Check a recent template for the actual name of the function.

                1 Reply Last reply Reply Quote 1
                • PeterJonesP
                  PeterJones
                  last edited by PeterJones

                  Yeah, it’s a Boolean that returns true, named isUnicode()

                  https://github.com/npp-plugins/plugindemo/blob/54dada1d6428dfcc218d3ff4ad940ebca0d2d466/src/NppPluginDemo.cpp#L165

                  Without that function, Notepad++ will assume the plugin was written for an ANSI-only Notepad++, which is not compatible with current Notepad++ builds.

                  1 Reply Last reply Reply Quote 1
                  • EkopalypseE
                    Ekopalypse @CAKEbuilder
                    last edited by Ekopalypse

                    @CAKEbuilder

                    as @PeterJones already posted you need to implement isUnicode function and return True.
                    In addition, these functions need to be implemented as well

                    isUnicode     -> return True always
                    getName       -> return your plugin name 
                    setInfo       -> informs your plugin about notepad++ and scintilla handles
                    beNotified    -> called in case of npp or scintilla events
                    messageProc   -> called in case of windows messages forwarded by npp
                    getFuncsArray -> return the functions which should be available within your plugin menu
                    
                    1 Reply Last reply Reply Quote 1
                    • First post
                      Last post
                    The Community of users of the Notepad++ text editor.
                    Powered by NodeBB | Contributors