It is currently April 27th, 2024, 5:07 pm

Debugging a plugin

Get help with creating, editing & fixing problems with skins
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Debugging a plugin

Post by jsmorley »

chilio wrote:Jup, didn't expect that it really wasn't worth the effort to build it outside (I already had a solution outside, so yeah, that happened ^^
Thanks for posting the location and explanation of guidgen: I couldn't find it myself as I never have worked with it before.
Sure. I mean it's certainly not impossible to build outside the SDK folder, but you really want / need to use the template of the .vcxproj file that is included with the examples, and you need to be sure you have it able to find the API folder, for both 32bit and 64bit configurations.

<AdditionalDependencies>..\..\API\x32\Rainmeter.lib;%(AdditionalDependencies)</AdditionalDependencies>

<AdditionalDependencies>..\..\API\x64\Rainmeter.lib;%(AdditionalDependencies)</AdditionalDependencies>

Those relative (or direct if you want) paths to the API must be right.
User avatar
SilverAzide
Rainmeter Sage
Posts: 2613
Joined: March 23rd, 2015, 5:26 pm

Re: Debugging a plugin

Post by SilverAzide »

chilio wrote:Jup, didn't expect that it really wasn't worth the effort to build it outside (I already had a solution outside, so yeah, that happened ^^
Thanks for posting the location and explanation of guidgen: I couldn't find it myself as I never have worked with it before.
In case you are using C# instead of C++, jsmorley's instructions for creating a C++ project are essentially identical for C# (aside from minor file name/extension variations).
Gadgets Wiki GitHub More Gadgets...
User avatar
SilverAzide
Rainmeter Sage
Posts: 2613
Joined: March 23rd, 2015, 5:26 pm

Re: Debugging a plugin

Post by SilverAzide »

jsmorley wrote:... That's it. Now go up one level, and open SDK-CPP.sln in Visual Studio. Add your project to the solution, go nuts with coding your plugin, and you can easily build either 32bit or 64bit debug or release versions of your work.
I know all this is on the manual page, but these screenshots and step-by-step instructions might make a super-helpful addition to the docs. :thumbup:
Gadgets Wiki GitHub More Gadgets...
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Debugging a plugin

Post by jsmorley »

SilverAzide wrote:I know all this is on the manual page, but these screenshots and step-by-step instructions might make a super-helpful addition to the docs. :thumbup:
I don't know. My issue with that is that to really fully describe how to create a plugin from soup to nuts is a lot more involved than that, as you first need to decide if you are going to install git to ensure you can stay current with the API as we change it, and how to then create a local repo on your hard drive and fork the remote SDK repo to it. Then you do those steps above, but then there are a couple of different ways to "test" the result. The most straightforward is to then copy the 64bit or 32bit .dll files created by the build into your %APPDATA%\Rainmeter\Plugins folder and restart Rainmeter, but there are also ways to do a complete build of the entire Rainmeter project and run your new plugin in that context.

I have a feeling that to do this right in the docs, trying to really "hand hold" those who are not familiar with C++ and VS and Rainmeter, might be a lot of documentation indeed, and would only be how "I" do things, not the only way to do them.

I'll have to chew on this a bit.
User avatar
SilverAzide
Rainmeter Sage
Posts: 2613
Joined: March 23rd, 2015, 5:26 pm

Re: Debugging a plugin

Post by SilverAzide »

jsmorley wrote:...I'll have to chew on this a bit.
Agreed. Perhaps not a change to the docs, per se, but maybe more like something for the Tips & Tricks and/or Featured Guides section...?
Gadgets Wiki GitHub More Gadgets...
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Debugging a plugin

Post by jsmorley »

SilverAzide wrote:Agreed. Perhaps not a change to the docs, per se, but maybe more like something for the Tips & Tricks and/or Featured Guides section...?
Yeah, might work better there, with a link in the docs.
User avatar
tjhrulz
Developer
Posts: 268
Joined: October 13th, 2016, 1:28 am
Location: Earth

Re: Debugging a plugin

Post by tjhrulz »

jsmorley wrote:Yeah, might work better there, with a link in the docs.
Yeah, this is why I had contemplated just kinda doing a how to video or something on it. Because while I know we want to avoid hand holding but some of this stuff is easily not known or overlooked by even a seasoned dev, especially if they have never built to .dll or used interop.