Git Product home page Git Product logo

Comments (6)

codingseb avatar codingseb commented on June 6, 2024

我的电脑是win10,使用VS2017,编译,然后把生成的DLL拷贝到\Notepad++\plugins\里面,打开Notepad++的时候提示不能加载。
My computer is win10, use VS2017, compile, and then copy the generated DLL to \Notepad++\plugins, when you open Notepad++, you can't load it.

CSharpRegexTools4Npp.dll is not compatible with the current version of Notepad++.

Hello,
Already some things to check.

  • If you have Notepad++ x64 you need to compile in x64 if x32 you need to compile in x32
  • Depending on your version of Notepad++ The plugins home has changed several times.
    • In last version it is in a sub directory named with the plugin name in "%PROGRAMFILES%\Notepad++\plugins" in our case %PROGRAMFILES%\Notepad++\plugins\CSharpRegexTools4Npp\CSharpRegexTools4Npp.dll
    • In Older version it can be in these See this for more infos
      • "%LOCALAPPDATA%\Notepad++\plugins"
      • "%PROGRAMDATA%\Notepad++\plugins"
      • "%PROGRAMFILES%\Notepad++\plugins" without sub directory
  • Normally if you have last versions of Notepad++ and you just give access to "%PROGRAMFILES%\Notepad++\plugins" to noadmin user you just need to Press launch (F5) from Visual Studio to automatically compile, copy the dll in the sub directory and launch Notepad++ for debug.

If none of above works. Maybe 2 more things.

  • Its based on NotepadPlusPlusPluginPack.Net it is for UTF-8 plugins.
    As I see you speak chinese (sorry but I personally only speak French and English) I don't know if it UTF-8 plugins works on systems with chinese characters.
  • For now on this repo I commit all my devs on master (Yes not good. I know). So depending on which commit you are it's maybe unstable. I will create a dev branch to avoid that. But for now try some commit or at least the last tag of released version. Or download the last stable version Here

from csharpregextools4npp.

codingseb avatar codingseb commented on June 6, 2024

At the moment. I am on Notepad++ 7.6.6 x64 Win 10 and VS 2019. But I started this project with VS 2017

from csharpregextools4npp.

miaoweiwei avatar miaoweiwei commented on June 6, 2024

我怎么使用Unicode去编译

from csharpregextools4npp.

miaoweiwei avatar miaoweiwei commented on June 6, 2024

At the moment. I am on Notepad++ 7.6.6 x64 Win 10 and VS 2019. But I started this project with VS 2017

我使用的是中文版的VS2017,不知道有没有影响

from csharpregextools4npp.

miaoweiwei avatar miaoweiwei commented on June 6, 2024

At the moment. I am on Notepad++ 7.6.6 x64 Win 10 and VS 2019. But I started this project with VS 2017

还有NppPlugin.DllExport.targets这个文件需要我更改什么吗?还需要做其他的操作吗?,谢谢啦

from csharpregextools4npp.

codingseb avatar codingseb commented on June 6, 2024

我怎么使用Unicode去编译
How do I use Unicode to compile ?
我使用的是中文版的VS2017,不知道有没有影响
I am using the Chinese version of VS2017, I don't know if it has any effect.

Yes it's possible. I don't know if you can download an english version of VS to test.
I think the use NotepadPlusPlusPluginPack.Net force to be in UTF-8.
Also ensure that all necessary nuget package are installed (Right Click on solution and "restore nuget packages")
And sometimes when I clone the repo again I need to restart VisualStudio several time after restoring packages and trying to compile before the first compilation succeed.

还有NppPlugin.DllExport.targets这个文件需要我更改什么吗?还需要做其他的操作吗?,谢谢啦
And what does the NppPlugin.DllExport.targets file need for me to change? Still need to do other operations? ,Thank you

NppPlugin.DllExport.targets is also a part of the NotepadPlusPlusPluginPack.Net. I just use it.
But I can try to explain some stuff.

The first part say that everything in this file will be take in account and execute just after the C# Compilation if it worked.

  <Target Name="AfterBuild"
          DependsOnTargets="GetFrameworkPaths"
          >

The next part is to help Notepad++ to load the plugin (as normally notepad++ need C++ plugins) it exports the necessary Functions to the not C# world. (These functions are in UnmanagedExports.cs)

    <PropertyGroup>
		<!-- LibToolPath is optional - it's needed to debug C++, but you can still debug the C# code without it
			If you don't have the C++ toolchain installed this is missing, but then you can't' debug C++ anyway -->
        <LibToolPath Condition="Exists('$(DevEnvDir)\..\..\VC\bin')">$(DevEnvDir)\..\..\VC\bin</LibToolPath>
    </PropertyGroup>
    <DllExportTask Platform="$(Platform)"
                   PlatformTarget="$(PlatformTarget)"
                   CpuType="$(CpuType)"
                   EmitDebugSymbols="$(DebugSymbols)"
                   DllExportAttributeAssemblyName="$(DllExportAttributeAssemblyName)"
                   DllExportAttributeFullName="$(DllExportAttributeFullName)"
                   Timeout="$(DllExportTimeout)"
                   KeyContainer="$(KeyContainerName)$(AssemblyKeyContainerName)"
                   KeyFile="$(KeyOriginatorFile)"
                   ProjectDirectory="$(MSBuildProjectDirectory)"
                   InputFileName="$(TargetPath)"
                   FrameworkPath="$(TargetedFrameworkDir);$(TargetFrameworkDirectory)"
                   LibToolPath="$(LibToolPath)"
                   LibToolDllPath="$(DevEnvDir)"
                   SdkPath="$(SDK40ToolsPath)"/>

The last part ensure that the necessary subdirectory is create in the corresponding x86/x64 plugins directory of Notepad++. And copy the dll of the plugin in the right place. (Compatible with last vesions of Notepad++, can be modified if you use an older version) (Warning, the copy only works if Notepad++ is stopped.

    <MakeDir Directories="$(MSBuildProgramFiles32)\Notepad++\plugins\$(TargetName)\" Condition="Exists('$(MSBuildProgramFiles32)\Notepad++\plugins\') AND !Exists('$(MSBuildProgramFiles32)\Notepad++\plugins\$(TargetName)\') AND '$(Platform)'=='x86'" />
    <Copy 
        SourceFiles="@(ReleaseFiles)" 
        DestinationFolder="$(MSBuildProgramFiles32)\Notepad++\plugins\$(TargetName)\" 
        Condition="Exists('$(MSBuildProgramFiles32)\Notepad++\plugins\$(TargetName)\') AND '$(Platform)'=='x86'"
        ContinueOnError="false" />
    <MakeDir Directories="$(ProgramW6432)\Notepad++\plugins\$(TargetName)\" Condition="Exists('$(ProgramW6432)\Notepad++\plugins\') AND !Exists('$(ProgramW6432)\Notepad++\plugins\$(TargetName)\') AND '$(Platform)'=='x64'" />
    <Copy
        SourceFiles="@(ReleaseFiles)" 
        DestinationFolder="$(ProgramW6432)\Notepad++\plugins\$(TargetName)\" 
        Condition="Exists('$(ProgramW6432)\Notepad++\plugins\$(TargetName)\') AND '$(Platform)'=='x64'"
        ContinueOnError="false" />

I don't know if this plugin is appropriate for a use in chinese in Notepad++ anyway. It has already some small bugs when the edited file is not in UTF-8 (but in ANSI for example)
Maybe already try to download a compiled version Here to see if it works and if it suit your needs.
Otherwise you can fork this project and try to adapt it to support not utf-8 encodings I think at least when it read and rewrite texts in Notepad++.

from csharpregextools4npp.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.