<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Npp Plugin - failing when &quot;string&quot; type is used]]></title><description><![CDATA[<p dir="auto">Hello,</p>
<p dir="auto">I am trying to resurrect the NppVerilog plugin, compiling it with MinGW - x86_64-w64-mingw32-g++ (x86_64-posix-seh-rev1, Built by MinGW-Builds project) 16.1.0.</p>
<p dir="auto">I actually reached the point where adding global variable “const string configFile = “/plugins/config/verilogConfig.txt”;” variable makes the plugin twice as bigger, unusable and refused by NPP (“The specified module cound not be found. DLL is not compatible…” etc.) while “const char configFile[] = “/plugins/config/verilogConfig.txt”;” is loaded by NPP without any issue.</p>
<p dir="auto">Is something like this know ? Mz NPP version is 8.6.4 - not the newest one but not too old either.</p>
<p dir="auto">Thank you for help.</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/27568/npp-plugin-failing-when-string-type-is-used</link><generator>RSS for Node</generator><lastBuildDate>Thu, 11 Jun 2026 19:28:44 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/27568.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 11 Jun 2026 14:32:20 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Npp Plugin - failing when &quot;string&quot; type is used on Thu, 11 Jun 2026 16:15:40 GMT]]></title><description><![CDATA[<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a> <a href="/post/105714">said</a>:</p>
<p dir="auto">I am assuming you never passed the <code>const char configFile[]</code> to a N++ message.</p>
</blockquote>
<p dir="auto">I do not pass the string anywhere and it already affects the plugin acceptance. It is just declared and that is all. It might be some bug in MinGW itself but I am not able to judge. If I remove the initialization and have <code>static const string configFile;</code> the plugin is ok, too.</p>
<p dir="auto">In the meantime I upgraded to version 8.9.6.4 (the newest one) but it behaves the same.</p>
<p dir="auto">Is there a way how to debug what is going wrong when plugin is opened ?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/105716</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/105716</guid><dc:creator><![CDATA[medvidec]]></dc:creator><pubDate>Thu, 11 Jun 2026 16:15:40 GMT</pubDate></item><item><title><![CDATA[Reply to Npp Plugin - failing when &quot;string&quot; type is used on Thu, 11 Jun 2026 15:30:53 GMT]]></title><description><![CDATA[<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/medvidec" aria-label="Profile: medvidec">@<bdi>medvidec</bdi></a> <a href="/post/105713">said</a>:</p>
<p dir="auto">NPP version is 8.6.4 - not the newest one but not too old either.</p>
</blockquote>
<p dir="auto">I mean, that was from Feb 2024 (more than two years ago), and there’s been roughly 35 newer versions released in the intervening time.  In software, 2+ years is ancient.</p>
<p dir="auto">That’s almost-definitely not the cause of your problem in this instance, but there have been a large number of important security fixes over that period, and choosing to not upgrade means your Notepad++ version has <em>known and published security vulnerabilities</em> (with exploits active in the wild), so it is much less secure than a modern Notepad++ version.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/105715</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/105715</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Thu, 11 Jun 2026 15:30:53 GMT</pubDate></item><item><title><![CDATA[Reply to Npp Plugin - failing when &quot;string&quot; type is used on Thu, 11 Jun 2026 15:22:35 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/medvidec" aria-label="Profile: medvidec">@<bdi>medvidec</bdi></a> ,</p>
<p dir="auto">I would normally ask that you check to make sure that your compiler’s bitness matches your N++ bitness (since I forget MinGW’s official naming scheme), but given that it works when you use <code>const char configFile[]</code>, you’ve presumably got that all worked out.</p>
<p dir="auto">There’s nothing specific about <code>string</code> which makes a plugin incompatible with N++ – or, at least, I use <code>std::string</code> and <code>std::wstring</code> throughout my MSVC-based plugins all the time.  There shouldn’t be any difference in syntax for <code>string</code>s betwen MSVC and MinGW.</p>
<p dir="auto">But <code>std::string</code> isn’t 100% drop-in replacement for <code>char*</code>: if you are passing to an API that requires <code>char*</code> (+), you would need to switch to <code>configFile.</code><a href="https://cplusplus.com/reference/string/string/c_str/" rel="nofollow ugc">c_str()</a> or <code>configFile.</code><a href="https://cplusplus.com/reference/string/string/data/" rel="nofollow ugc">data()</a> where the <code>char*</code> version of the variable just used <code>configFile</code>.  So that would be the first avenue of exploration I’d go down in debugging – seeing whether the function calls that are using <code>configFile</code> are compatible with <code>string</code>, or whether you need to extract the raw c-style pointer out of the <code>std::string</code> object.</p>
<p dir="auto">(And having to build the std::string interface in the DLL, vs being able to use pure-c++ char-manipulation could increase the DLL size significantly, so depending on the size of your plugin, that could “double” it.)</p>
<p dir="auto">+: The <a href="https://npp-user-manual.org/docs/plugin-communication/" rel="nofollow ugc">N++ plugin-communication messages</a> are almost all <code>wchar_t*</code>-based (with one or two <code>char*</code>), not <code>std::string</code> based.  Because of that, I am assuming you never passed the <code>const char configFile[]</code> to a N++ message without conversion, so I don’t think it’s the NPP API that’s causing the problem.  But there are a lot of win32 API calls that require <code>char*</code> or <code>wchar_t*</code>, so passing in a <code>string</code> or <code>wstring</code> to one of those would not work, and you’d instead</p>
]]></description><link>https://community.notepad-plus-plus.org/post/105714</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/105714</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Thu, 11 Jun 2026 15:22:35 GMT</pubDate></item></channel></rss>