Trouble compiling test plugin (ANSI error)
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.
I’m using Visual Studio 2019, should I be using an older version for plugin development?
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
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.
Yeah, it’s a Boolean that returns true, named
Without that function, Notepad++ will assume the plugin was written for an ANSI-only Notepad++, which is not compatible with current Notepad++ builds.
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