It is currently April 23rd, 2024, 7:18 pm

Plugin development in C#: success

Share and get help with Plugins and Addons
User avatar
psouza4
Developer
Posts: 30
Joined: December 2nd, 2010, 1:56 pm
Location: Meridian, ID, USA

Re: Plugin development in C#: success

Post by psouza4 »

It may be easier to wipe what you have and start fresh with my template again. This time, go into the project settings (For both x86 and x64 independently) and change the target framework version there.
User avatar
Tamschi
Posts: 4
Joined: December 16th, 2010, 10:45 pm

Re: Plugin development in C#: success

Post by Tamschi »

That's pretty much what I did, but I had to update a few of the framework references to link them to the 4.0 versions. Even with the template, I only have the option to include mscorlib.dll 4.0 or the projects won't build.
User avatar
psouza4
Developer
Posts: 30
Joined: December 2nd, 2010, 1:56 pm
Location: Meridian, ID, USA

Re: Plugin development in C#: success

Post by psouza4 »

I'll have to mess with it and see if I have the same issues myself. I haven't had a need for .NET 4.0 (at all), personally.
User avatar
Tamschi
Posts: 4
Joined: December 16th, 2010, 10:45 pm

Re: Plugin development in C#: success

Post by Tamschi »

It's mostly performance and data related, but some of the things in the newer version are really useful. As rainmeter loads 2.0, here are some of the features I use the most that were introduced later:

- extension methods
- LINQ
- WPF
- high performance collections

Version 4.0 has In-Process Side-by-Side Execution, so it will support anything starting at 2.0 at the same time. This should also get rid of the unsafe code in the plugin .dlls :)

Anyway, I'm really looking forward to this, awesome work so far :thumbup:
cytrex
Posts: 4
Joined: April 15th, 2011, 12:55 pm

Re: Plugin development in C#: success

Post by cytrex »

Hi i tried the C# Solution and when i klick refrsh skin on the Template Plugin rainmeter hangs

any idea??
User avatar
psouza4
Developer
Posts: 30
Joined: December 2nd, 2010, 1:56 pm
Location: Meridian, ID, USA

Re: Plugin development in C#: success

Post by psouza4 »

Without seeing what you modified, nope: no ideas.

Going to need more to go off of.
cytrex
Posts: 4
Joined: April 15th, 2011, 12:55 pm

Re: Plugin development in C#: success

Post by cytrex »

I only changed in the getstring method of the PluginCode.cs that it return a fix string.

that was all.

using System;
using System.Collections.Generic;

// The bulk of your plugin's code belongs in this file.
namespace CSPluginTemplate
{
class PluginCode
{
// 'Update', 'Update2', and 'GetString' all return data back to Rainmeter, depending on
// if the Rainmeter measure wants a numeric value or a string/text data.
//
// The 'Instance' member contains all of the data necessary to read the INI file
// passed to your plugin when this instance was first initialized. Remember: your plugin
// may be initialized multiple times. For example, a plugin that reads the free space
// of a hard drive may be called multiple times -- once for each installed hard drive.

public UInt32 Update(Rainmeter.Settings.InstanceSettings Instance)
{
return 0;
}

public double Update2(Rainmeter.Settings.InstanceSettings Instance)
{
return 0.0;
}

public string GetString(Rainmeter.Settings.InstanceSettings Instance)
{
return "Test";
}


// 'ExecuteBang' is a way of Rainmeter telling your plugin to do something *right now*.
// What it wants to do can be defined by the 'Command' parameter.
public void ExecuteBang(Rainmeter.Settings.InstanceSettings Instance, string Command)
{
return;
}
}
}
User avatar
psouza4
Developer
Posts: 30
Joined: December 2nd, 2010, 1:56 pm
Location: Meridian, ID, USA

Re: Plugin development in C#: success

Post by psouza4 »

And you compiled both the x86 and x64 version of your plugin? Did you make sure to copy the correct one to your Rainmeter plugins folder?

Did you check Rainmeter's About page to make sure it was being loaded correctly?

How about debug logging? Any exceptions thrown will be sent there -- have you checked it?

I'm in IRC if you want realtime help.
cytrex
Posts: 4
Joined: April 15th, 2011, 12:55 pm

Re: Plugin development in C#: success

Post by cytrex »

i tested it now with an other computer also windows 7 did a build of rainmeter and my plugin an i habe the same issiu.

It always freezes