• Login
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.
  • C
    CAKEbuilder
    last edited by Nov 24, 2019, 4:52 PM

    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.

    E 1 Reply Last reply Nov 24, 2019, 9:10 PM Reply Quote 0
    • R
      rinku singh
      last edited by rinku singh Nov 24, 2019, 5:19 PM Nov 24, 2019, 5:18 PM

      @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
      • C
        CAKEbuilder
        last edited by Nov 24, 2019, 5:37 PM

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

        A 1 Reply Last reply Nov 24, 2019, 6:41 PM Reply Quote 0
        • R
          rinku singh
          last edited by rinku singh Nov 24, 2019, 6:15 PM Nov 24, 2019, 6:14 PM

          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
          • A
            Alan Kilborn @CAKEbuilder
            last edited by Nov 24, 2019, 6:41 PM

            @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
            • P
              PeterJones
              last edited by PeterJones Nov 24, 2019, 7:24 PM Nov 24, 2019, 7:24 PM

              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
              • P
                PeterJones
                last edited by PeterJones Nov 24, 2019, 7:33 PM Nov 24, 2019, 7:30 PM

                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
                • E
                  Ekopalypse @CAKEbuilder
                  last edited by Ekopalypse Nov 24, 2019, 9:10 PM Nov 24, 2019, 9:10 PM

                  @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
                  3 out of 8
                  • First post
                    3/8
                    Last post
                  The Community of users of the Notepad++ text editor.
                  Powered by NodeBB | Contributors