<?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[How to debug plugins during development?]]></title><description><![CDATA[<p dir="auto">What is the best way to get debug output while developing plugins? I am new to Notepad++ plugin development, and can’t seem to find any good way to debug my plugin. I am writing it in C++ in Visual Studio 2015. Any advice would be appreciated, Thanks!</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/11226/how-to-debug-plugins-during-development</link><generator>RSS for Node</generator><lastBuildDate>Tue, 16 Jun 2026 05:15:07 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/11226.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 02 Feb 2016 19:56:30 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to debug plugins during development? on Thu, 24 Sep 2020 16:12:31 GMT]]></title><description><![CDATA[<ul>
<li>Output to Dialog</li>
</ul>
<pre><code>	TCHAR buffer[100]={0};
	wsprintf(buffer,TEXT("position=%d"), _oldproc);
	::MessageBox(NULL, buffer, TEXT(""), MB_OK);
</code></pre>
<ul>
<li>Output to the status bar</li>
</ul>
<pre><code>	TCHAR buffer[256]={0};
	wsprintf(buffer,TEXT("IdealRows=%d"), IdealRows);
	::SendMessage(_pMainWindow-&gt;getHParent(), NPPM_SETSTATUSBAR, STATUSBAR_DOC_TYPE, (LPARAM)buffer);
</code></pre>
<ul>
<li>Create Unit Tests<br />
See examples in the TextFx plugin :  <a href="https://github.com/HQJaTu/NPPTextFX/blob/VS2017-x64/Tests/scintilla_simu.cpp" rel="nofollow ugc">https://github.com/HQJaTu/NPPTextFX/blob/VS2017-x64/Tests/scintilla_simu.cpp</a></li>
</ul>
]]></description><link>https://community.notepad-plus-plus.org/post/57900</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/57900</guid><dc:creator><![CDATA[KnIfER]]></dc:creator><pubDate>Thu, 24 Sep 2020 16:12:31 GMT</pubDate></item><item><title><![CDATA[Reply to How to debug plugins during development? on Tue, 14 Jul 2020 18:59:41 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/dail" aria-label="Profile: dail">@<bdi>dail</bdi></a> said in <a href="/post/55872">How to debug plugins during development?</a>:</p>
<blockquote>
<p dir="auto">(wow that was over 4 years ago),</p>
</blockquote>
<p dir="auto">Nice that you are still around after that long. :-)</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ekopalypse" aria-label="Profile: Ekopalypse">@<bdi>Ekopalypse</bdi></a></p>
<blockquote>
<p dir="auto">if you run this under the VS Debugger … it will be consumed by it and not forwarded to other windows.</p>
</blockquote>
<p dir="auto">That may be a fairly valid point. :-)<br />
I was actually trying to set it up for a future need where I wouldn’t be running under the debugger.<br />
And running under the debugger while setting it up seemed pretty natural, because I wanted to verify that I actually hit the code I thought I was hitting, especially when it wasn’t working.</p>
<p dir="auto">I will try without the debugger now…<br />
(…a bit of time goes by…)<br />
You <a class="plugin-mentions-user plugin-mentions-a" href="/user/ekopalypse" aria-label="Profile: Ekopalypse">@<bdi>Ekopalypse</bdi></a> sir, hit the nail right on the head:<br />
<img src="/assets/uploads/files/1594753045165-2510c7de-fbba-4ff0-9098-f9bb48e7c83b-image.png" alt="2510c7de-fbba-4ff0-9098-f9bb48e7c83b-image.png" class=" img-fluid img-markdown" /><br />
Thank you for the help.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/55876</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/55876</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Tue, 14 Jul 2020 18:59:41 GMT</pubDate></item><item><title><![CDATA[Reply to How to debug plugins during development? on Tue, 14 Jul 2020 18:27:55 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: Alan-Kilborn">@<bdi>Alan-Kilborn</bdi></a></p>
<p dir="auto">I can imaging that if you run this under the VS Debugger that it will be consumed by it and not forwarded to other windows.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/55873</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/55873</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Tue, 14 Jul 2020 18:27:55 GMT</pubDate></item><item><title><![CDATA[Reply to How to debug plugins during development? on Tue, 14 Jul 2020 18:27:30 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: Alan-Kilborn">@<bdi>Alan-Kilborn</bdi></a></p>
<p dir="auto">I only used OutputDebugString() in a very limited fashion a while ago (wow that was over 4 years ago), so I’m not sure what other conditions affect it actually showing up in DebugView. 99.9% of all my debugging is stepping through the code in Visual Studio.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/55872</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/55872</guid><dc:creator><![CDATA[dail]]></dc:creator><pubDate>Tue, 14 Jul 2020 18:27:30 GMT</pubDate></item><item><title><![CDATA[Reply to How to debug plugins during development? on Tue, 14 Jul 2020 14:18:30 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/dail" aria-label="Profile: dail">@<bdi>dail</bdi></a> said in <a href="/post/13757">How to debug plugins during development?</a>:</p>
<blockquote>
<p dir="auto">When you say “debug output” you mean like something “nicer” than logging data to a file? If so what I’ve used in the past is OutputDebugString(). I’m not sure what Windows does with this internally but you can use a small application from Windows called DebugView and it will show those messages being logged in real time.</p>
</blockquote>
<p dir="auto">So I was trying this in a plugin I am dabbling in.<br />
And I couldn’t get it to work.</p>
<p dir="auto">I put my OutputDebugString() call into the code; it compiles and links just fine.<br />
But when I run it, I don’t see anything in the DebugView window.</p>
<p dir="auto">If I set a breakpoint on the OutputDebugString() call, it gets hit.<br />
I switched over to N++ source code and added an OutputDebugString() call there; same thing happens – breakpoint hit but no code written to the debug-collector window.</p>
<p dir="auto">However, if I switch over to Python, running this little <a href="https://gist.github.com/wh13371/92df4715fc17eb74299d" rel="nofollow ugc">DEMO</a>, I <em><strong>do</strong></em> get output in the DebugView window:</p>
<p dir="auto"><img src="/assets/uploads/files/1594735848500-dde6b517-9399-4055-807a-b1c07cee7796-image.png" alt="dde6b517-9399-4055-807a-b1c07cee7796-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">The Python test seems to validate, well, something, but I don’t know why I’m not getting any debug output when running my plugin or N++ main source code…  Any ideas?</p>
<p dir="auto">Late thing I noticed:  When I start running N++ source under the debugger, I get a line in the DebugView output:</p>
<pre><code>[11196] NVWMI - Base Profile [c:/............/notepad-plus-plus/powereditor/visual.net/x64/unicode debug/notepad++.exe] was launched and [Base Profile] profile was applied
</code></pre>
<p dir="auto">but that seems to be just a startup notification; it still isn’t outputting my simple test string at the right time via <code>OutputDebugString(TEXT("hello"));</code></p>
<p dir="auto">So, again, a call for ideas?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/55855</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/55855</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Tue, 14 Jul 2020 14:18:30 GMT</pubDate></item><item><title><![CDATA[Reply to How to debug plugins during development? on Sat, 09 Feb 2019 17:02:05 GMT]]></title><description><![CDATA[<p dir="auto">hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/moon6969" aria-label="Profile: moon6969">@<bdi>moon6969</bdi></a></p>
<p dir="auto">thank you for taking the time to share every of your debugger solutions, including vs2017 now.<br />
it’s very helpful and appreciated. 👍</p>
]]></description><link>https://community.notepad-plus-plus.org/post/39516</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/39516</guid><dc:creator><![CDATA[Meta Chuh]]></dc:creator><pubDate>Sat, 09 Feb 2019 17:02:05 GMT</pubDate></item><item><title><![CDATA[Reply to How to debug plugins during development? on Sat, 09 Feb 2019 14:10:25 GMT]]></title><description><![CDATA[<p dir="auto">Got this issue again with VS2017 and NPP 7.6.3 source.<br />
The issue appears to be related to the NPP projects default Debugger Type setting of “Auto”… so it was assuming the C++ Native debugger based on the NPP exe.<br />
Changing this to “Managed Only” or “Mixed” sorted it…<br />
<img src="https://camo.nodebb.org/10eb386bc2d3d150840e1b247fb32f8686a2a86f?url=https%3A%2F%2Fi.imgur.com%2FzIcvP7B.png" alt="NPPdebugType" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.notepad-plus-plus.org/post/39507</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/39507</guid><dc:creator><![CDATA[moon6969]]></dc:creator><pubDate>Sat, 09 Feb 2019 14:10:25 GMT</pubDate></item><item><title><![CDATA[Reply to How to debug plugins during development? on Sun, 01 Apr 2018 14:41:33 GMT]]></title><description><![CDATA[<p dir="auto">I got the same issue with a new plugin after changing my NPP source to v7.5.6.</p>
<p dir="auto">It seems to be caused by the C# plugin being targeted to “Any CPU” in the configuration manager - even though the C# project properties showed “Platform: Active (x86)”, the “Platform target” was “Any CPU”.</p>
<p dir="auto">To change it I had to open the configuration manager and create a new x86 Platform on the C# plugin line as shown here:<br />
<img src="https://camo.nodebb.org/d35e0b7ea8b075b63462c36bf54bef5a818bd9cd?url=https%3A%2F%2Fi.imgur.com%2F3rnXTgP.png" alt="Imgur" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.notepad-plus-plus.org/post/31373</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/31373</guid><dc:creator><![CDATA[moon6969]]></dc:creator><pubDate>Sun, 01 Apr 2018 14:41:33 GMT</pubDate></item><item><title><![CDATA[Reply to How to debug plugins during development? on Sun, 30 Jul 2017 09:41:52 GMT]]></title><description><![CDATA[<p dir="auto">Thanks Claudia.</p>
<p dir="auto">I did some more experiments with the “Only build startup projects and dependencies on Run” setting, but it had no effect. I believe this setting is only relevant in bigger solutions… in my test case there are no dependencies and only one project!</p>
<p dir="auto">To get some perspective I downloaded a more up to date C# plugin: <a href="https://github.com/phdesign/NppToolBucket" rel="nofollow ugc">phdesign/NppToolBucket</a> (nice work thanks Paul!)</p>
<p dir="auto">The provided .sln file worked flawlessly on VS2017 without modifcation (other than pointing it to my test notepad++ instance).</p>
<p dir="auto">So I  compared in detail <a href="http://NotepadPlusPlusPluginPack.Net" rel="nofollow ugc">NotepadPlusPlusPluginPack.Net</a> and NppToolBucket and came to the conclusion my issue is probably in the DllExport section and possibly related to using VS2017 rather than VS2015.</p>
<p dir="auto">My head hurts now, so I am just going to run with NppToolBucket as my learning base!</p>
<p dir="auto">Cheers.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/25987</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/25987</guid><dc:creator><![CDATA[moon6969]]></dc:creator><pubDate>Sun, 30 Jul 2017 09:41:52 GMT</pubDate></item><item><title><![CDATA[Reply to How to debug plugins during development? on Sat, 29 Jul 2017 22:00:37 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/moon6969" aria-label="Profile: moon6969">@<bdi>moon6969</bdi></a></p>
<p dir="auto">It’s been a while since I used dotnet languages but as far as I remember there<br />
is a default settings which prevents dependencies from building at compile time.<br />
Means only the startup project gets compiled but dependencies are build at runtime.<br />
Could this be your issue as well?</p>
<p dir="auto">Cheers<br />
Claudia</p>
]]></description><link>https://community.notepad-plus-plus.org/post/25980</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/25980</guid><dc:creator><![CDATA[Claudia Frank]]></dc:creator><pubDate>Sat, 29 Jul 2017 22:00:37 GMT</pubDate></item><item><title><![CDATA[Reply to How to debug plugins during development? on Sat, 29 Jul 2017 21:50:41 GMT]]></title><description><![CDATA[<p dir="auto">I’m trying to get source level debugging working in VS2017 and the current C# demo plugin templates from  <a href="https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net" rel="nofollow ugc">kbilsted/NotepadPlusPlusPluginPack.Net</a>.</p>
<p dir="auto">It builds and runs fine (Debug/x86), and in VS I can attach to a running instance of notepad++ and hit breakspoints etc. Marvellous!</p>
<p dir="auto">However I just can’t figure out how to get the debugger to work when I try and launch in the VS IDE with F5.</p>
<p dir="auto">I’ve pointed VS to the exact same notepad++.exe, and it launches fine on F5, but the breakpoints just dont fire.<br />
In VS the breakpoints display as a hollow circle (instead of solid red dot) and reads<br />
“<em>The breakpoint will not currently be hit. No executable code of the debugger’s target code is associated with this line.<br />
Possible causes include: conditional compilation, compiler optimisations, or the target architecture of this line is not supported by the current debugger code type.</em>”<br />
<img src="https://camo.nodebb.org/8dba1f006d6f67e52ccecdd2d010c803908b664c?url=http%3A%2F%2Fi.imgur.com%2FFcFIieV.png" alt="Imgur" class=" img-fluid img-markdown" /></p>
<p dir="auto">If I look at “modules” screen in VS I can see the pdb is found just fine, but there are two copies of the demo.dll loaded.<br />
<img src="https://camo.nodebb.org/1436cac1980287c4a94ca11c7624620b9e53d4da?url=http%3A%2F%2Fi.imgur.com%2FR4odxcx.png" alt="Imgur" class=" img-fluid img-markdown" /><br />
I notice the 2nd one has “The module did not load at the default load address.”<br />
Both lines show the same debug symbols (C:\6\Dev\npp.7.4.2.bin\plugins\Demo.pdb) and are connected to the same npp PID (running from C:\6\Dev\npp.7.4.2.bin\notepad++.exe).</p>
<p dir="auto">If I then “Stop Debugging” in VS and instead launch C:\6\Dev\npp.7.4.2.bin\notepad++.exe directly from Explorer, I can simply attach VS and debug successfully. In this case modules view shows only a single demo.dll…<br />
<img src="https://camo.nodebb.org/73d7d8b767a9b2e7713629825a5810499555b6ae?url=http%3A%2F%2Fi.imgur.com%2FAhXVDtJ.png" alt="Imgur" class=" img-fluid img-markdown" /></p>
<p dir="auto">I’ve been experimenting all day to try and get it working - cleaning, deleting obj, various arcane settings, a fresh copy of the demo source.</p>
<p dir="auto">Any suggestions?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/25979</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/25979</guid><dc:creator><![CDATA[moon6969]]></dc:creator><pubDate>Sat, 29 Jul 2017 21:50:41 GMT</pubDate></item><item><title><![CDATA[Reply to How to debug plugins during development? on Tue, 19 Apr 2016 12:19:00 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/dail" aria-label="Profile: dail">@<bdi>dail</bdi></a><br />
Nice. I had no idea it could be so easily done. Thanks for the tip.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/15504</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/15504</guid><dc:creator><![CDATA[Jim Dailey]]></dc:creator><pubDate>Tue, 19 Apr 2016 12:19:00 GMT</pubDate></item><item><title><![CDATA[Reply to How to debug plugins during development? on Mon, 18 Apr 2016 21:49:21 GMT]]></title><description><![CDATA[<p dir="auto">To make the source level debugging easier you can also set a post-build event to copy the DLL to the plugins directory and set the N++ exe as the command to run when debugging. After that is as simple as pressing <code>F5</code>.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/15496</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/15496</guid><dc:creator><![CDATA[dail]]></dc:creator><pubDate>Mon, 18 Apr 2016 21:49:21 GMT</pubDate></item><item><title><![CDATA[Reply to How to debug plugins during development? on Mon, 18 Apr 2016 21:01:24 GMT]]></title><description><![CDATA[<p dir="auto">You can also do source-level debugging.</p>
<p dir="auto">Build a debug version of your DLL and put it in the NPP plugins directory.  Then, after you start up NPP, Go to Visual Studio and select <strong>Debug-&gt;Attach To Process…</strong> and then find the instance of NPP you just started and select it.</p>
<p dir="auto">Now you can set breakpoints in your plugin and debug away. :-)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/15495</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/15495</guid><dc:creator><![CDATA[Jim Dailey]]></dc:creator><pubDate>Mon, 18 Apr 2016 21:01:24 GMT</pubDate></item><item><title><![CDATA[Reply to How to debug plugins during development? on Sun, 17 Apr 2016 10:48:11 GMT]]></title><description><![CDATA[<p dir="auto">MessageBox is rather primitive, but quite effective. I wrote a debugging function mprintf with the same arguments as printf, which formats a buffer using sprintf and then passes it to MessageBox.</p>
<p dir="auto">Unless the change of focus resulting from the display of the message box interferes with your work, this should help.</p>
<p dir="auto">David</p>
]]></description><link>https://community.notepad-plus-plus.org/post/15450</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/15450</guid><dc:creator><![CDATA[David Bailey]]></dc:creator><pubDate>Sun, 17 Apr 2016 10:48:11 GMT</pubDate></item><item><title><![CDATA[Reply to How to debug plugins during development? on Wed, 03 Feb 2016 18:46:00 GMT]]></title><description><![CDATA[<p dir="auto">When you say “debug output” you mean like something “nicer” than logging data to a file? If so what I’ve used in the past is <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa363362%28v=vs.85%29.aspx" rel="nofollow ugc">OutputDebugString()</a>. I’m not sure what Windows does with this internally but you can use a small application from Windows called <a href="https://technet.microsoft.com/en-us/sysinternals/debugview.aspx" rel="nofollow ugc">DebugView</a> and it will show those messages being logged in real time.</p>
<p dir="auto">Take a look at the <a href="http://sourceforge.net/p/gedcomlexer/code/HEAD/tree/trunk/src/" rel="nofollow ugc">GEDCOM Lexer plugin</a>, specifically the <code>DebugTrace.h</code> and <code>DebugTrace.cpp</code> files that nicely wrap that function and can easily be “turned off” in release mode. You can see it being used through that plugin’s code.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/13757</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/13757</guid><dc:creator><![CDATA[dail]]></dc:creator><pubDate>Wed, 03 Feb 2016 18:46:00 GMT</pubDate></item><item><title><![CDATA[Reply to How to debug plugins during development? on Tue, 02 Feb 2016 22:14:05 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/chriscro111" aria-label="Profile: chriscro111">@<bdi>chriscro111</bdi></a>,</p>
<p dir="auto">I have no experience with c++, so I don’t know whether my advise is of any help for you.<br />
When I’m using <a href="http://dot.net" rel="nofollow ugc">dot.net</a> (sharpevelop), I redirect the output path of the dll to the plugins directory<br />
of a test npp installation (a zipped one) and add that external program npp should be started when debugging.</p>
<p dir="auto">Cheers<br />
Claudia</p>
]]></description><link>https://community.notepad-plus-plus.org/post/13744</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/13744</guid><dc:creator><![CDATA[Claudia Frank]]></dc:creator><pubDate>Tue, 02 Feb 2016 22:14:05 GMT</pubDate></item></channel></rss>