|
vitalyb
|
 |
« on: November 23, 2007, 11:23:01 PM » |
|
Download linkhttp://vitalyb.dcmembers.com/CSharpSDK.zipInstallation1) Unpack the attached zip to: \My Documents\Visual Studio 2005\Projects\FARR Plugins2) Copy FARR C# plugin.zip from \My Documents\Visual Studio 2005\Projects\FARR Plugins to \My Documents\Visual Studio 2005\Templates\ProjectTemplates. TutorialDeveloping C# plugins for FARR is now easier than ever. To create your first plugin follow these steps: 1) Run Visual Studio 2005 2) File -> New Project -> Visual C# -> FARR C# plugin (if you don't see it here, make sure you did step 2 in the installation). 3) Set the location of the project to: \My Documents\Visual Studio 2005\Projects\FARR Plugins\ (make sure "Create directory for solution" is checked). 4) Enter a name for your plugin and press OK. For the sake of the example we'll call it SamplePlugin. 5) Compile it. It should automatically be copied to FARR plugin folder and then restart FARR. 6) When FARR comes up you can trigger your plugin by writing "SamplePlugin" (case sensitive!). If all worked well, you should have your very own first plugin! Go ahead and customize for your own needs. If something is broken, don't panic, it is rather easy to mess the whole plugin simply by deleting one line too much in the main FARR functions. Just go back step by step until you find which part you removed. Enjoy! Simplified SDKAs you can see from the generated template there are 3 main classes that you will need to use: - FARRCSharpPluginBase - The base class of all the plugins. Contains the metadata that describes the plugin and accepts in its constructor the main ActionList of the plugin.
- ActionList - Represents a list of actions. Your plugin must have at least one ActionList. ActionList is called with a certain string that causes its ActionItems to be displayed.
- ActionItem - Represents a single action on the list, part of the representation is the text that is displayed on the item but also the kind of action that happens when the user executes an item.
For further understanding I suggest to play with the various functions of the classes. You can find better examples of use in these plugins (ordered by complexity): - FARREnviormentVariables
- FARRGoogleCalendar
- FARRTunes
News- 19/10/2008 The simplified layer of that allows a more simple and object oriented design of plugins also there is a new template that simplifies the creation of new plugins.
- 12/02/2008 I've uploaded a new version of SDK and all my C# plugins (FARRTunes, FARRAltTab and FARREnviormentVariables). It should resolve the following issues:
- The problem with "FARR won't close after program launch" as described here: http://www.donationcoder....m/index.php?topic=12210.0
- The error of "Unable to retreieve types" as described in the message-box picture below.
- Now whenever there is an exception or an error you should see WHICH plugin was causing it.
Make sure you update ALL 3 plugins (GCUpdater should help you out here). Besides that anyone that used SDK to create a plugin should get latest version and recompile (specifically, FARRGoogleSuggest). What's in the package- InstallPlugin.exe - That's the part that is for all developers. If you put this little script to the "Post Build Event" (It exists most compilers) it will auto copy your plugin to FARR directory, close FARR and reopen it. This way, whenever you build your plugin, FARR is ready to test the latest version. For those who want to fiddle with the script I also included the source in InstallPlugin.ahk. For example, in my FARRAltTab plugin the PostBuild event looks like this:
"$(SolutionDir)..\InstallPlugin.exe" "$(TargetDir)\" "C:\Program Files\FindAndRunRobot\Plugins\FARRAltTab\\" - FARR CSharp SDK.chm - I compiled using NDoc a pretty referece file, some was copied was Mouser documentation and some I wrote myself. It isn't complete but it is better than nothing
 - FARR CSharp SDK - The main solution that holds two projects. The first one is FARRPluginRCW which is written in CLI/C++ (managed C++) and holds the actual base class for all your C# plugins. The second project is the source of FARRAltTab. Use it as your main example as you develop your plugins
- FARRAltTab source code - The source of the FARRAltTab plugin: http://www.donationcoder....m/index.php?topic=10988.0
- FARRTunes source code - The source of the FARRTunes plugin: http://www.donationcoder....m/index.php?topic=11545.0
And more!Known issues- If you don't see the C# plugin in the FARR plugin list after the installation then download the following update from Microsoft.
- If you get the following messagebox:
System.Exception: Unable to load the plugin C# assembly at FARRPluginRCW.LoadPlugin() It is probably because you got an old version of FARRAltTab. It is suggested to DELETE the folder of FARRAltTab and download the latest one.
Some people get the following error using some of plugins, it can be sometimes resolved by getting the latest version. This issue should be RESOLVED if it isn't, let me know:  Currently there is a bug that limits the amount of active C# plugins to 1. If you are interested in developing a plugin, remove the FARRAltTab first from FARR plugin directory (See more info here). Stay in touchI will post all the updates/fixes for now to the SDK in this thread until it is deemed stable and can be merged with the main SDK. Enjoy!
|
|
|
|
« Last Edit: October 19, 2008, 02:28:52 AM by vitalyb »
|
Logged
|
|
|
|
|
mouser
|
 |
« Reply #1 on: November 24, 2007, 12:00:54 AM » |
|
|
|
|
|
|
Logged
|
|
|
|
|
vitalyb
|
 |
« Reply #2 on: November 24, 2007, 07:28:26 AM » |
|
 By the way, even though I wrote "C#" in the post, any .NET language can be used instead with this SDK. From VB.NET to J# so truly anyone can now write a plugin! If
|
|
|
|
|
Logged
|
|
|
|
|
|
mouser
|
 |
« Reply #3 on: November 24, 2007, 09:44:48 AM » |
|
By the way, even though I wrote "C#" in the post, any .NET language can be used instead with this SDK. From VB.NET to J# so truly anyone can now write a plugin! COOL!
|
|
|
|
|
Logged
|
|
|
|
|
jpgrosen
|
 |
« Reply #4 on: December 11, 2007, 01:46:25 PM » |
|
Hi,
Thanks for the .NET wrapper. I am trying to make a C# plugin but am faced with the following exception System.NullReferenceException: Object reference not set to an instance of an object. at FARRPluginRCW.LoadPlugin()
I get the exception everytime I have both my plugin and FARRAltTab installed. (Or even if I just install the FARRAltTab plugin twice). Could it be an issue with the C++ wrapper?
Sincerely
JP
|
|
|
|
|
Logged
|
|
|
|
|
vitalyb
|
 |
« Reply #5 on: December 11, 2007, 02:48:43 PM » |
|
NullReferenceException is a .NET exception. What did you copy to FARR plugin directory? Did you make your plugin directory with both the wrapper and your plugin inside?
|
|
|
|
|
Logged
|
|
|
|
|
jpgrosen
|
 |
« Reply #6 on: December 11, 2007, 03:04:32 PM » |
|
Yes I copied both the wrapper and my plugin. I also got the exception (without my plugin folder) by simply dublicating the FARRAltTab plugin folder.
Sincerely JP
|
|
|
|
|
Logged
|
|
|
|
|
vitalyb
|
 |
« Reply #7 on: December 11, 2007, 04:02:06 PM » |
|
Hmm. Well. Unless you can debug it yourself, send me the files, see if I can reproduce it  I'll PM you my gmail.
|
|
|
|
|
Logged
|
|
|
|
|
vitalyb
|
 |
« Reply #8 on: December 11, 2007, 04:14:11 PM » |
|
While we're on the topic  Updated the AltTab source plugin to the current latest version (1.15) and updated the SDK. The only thing that got added is an option to send to FARR callback commands (e.g change the status bar).
|
|
|
|
|
Logged
|
|
|
|
|
vitalyb
|
 |
« Reply #9 on: December 21, 2007, 10:38:42 AM » |
|
I wanted to update potential developers on the status of the SDK. Currently there is an issue with the amount of C# plugins you can put to FARR directory. The reason is that each FarrRCW.dll is .NET assembly and they are all identical in .NET sense (same identity). Basically it means that for every C# plugin there must be a unique RCW dll (and not just a copy as I thought). Now, recompiling the RCW dll is relatively easy process (rename project & recompile) however, not everyone have C++ compilers and I am aware that many programmers out there never did anything beside C# and possibly don't have anything that can compile C++ installed. I still hope I can find a way to let anyone just change the RCW dll identity without any additional tools as the only other alternative I see now, is forcing people to recompile SDK everytime they want to develop a plugin. In the while, if you have a plugin you want to develop, simply remove FARRAltTab from your plugins during development process so you'll always have only one C# plugin. If you want to publish it, let me know and I'll send you a unique RCW dll. Hope it will get solved soon  .
|
|
|
|
|
Logged
|
|
|
|
|
vitalyb
|
 |
« Reply #10 on: December 22, 2007, 04:32:09 PM » |
|
Well, I solved this issue. Basically each time you will compile your plugin, it will compile in the background you very own RCW version. I'll upload the latest version of SDK along with the instructions (a bit more complex then before, I'm afraid) later. In the while, here's something little from a future add-in I am developing: 
|
|
|
|
|
Logged
|
|
|
|
|
mouser
|
 |
« Reply #11 on: December 23, 2007, 10:17:42 PM » |
|
cooool
|
|
|
|
|
Logged
|
|
|
|
|
vitalyb
|
 |
« Reply #12 on: December 28, 2007, 05:13:33 PM » |
|
Uploaded the latest SDK that fixes the bug mentioned by jpgrosen (it was a bitch). Also includes the source of FARRTunes.
|
|
|
|
|
Logged
|
|
|
|
|
mouser
|
 |
« Reply #13 on: December 29, 2007, 12:08:05 AM » |
|
awesome!
|
|
|
|
|
Logged
|
|
|
|
|
vitalyb
|
 |
« Reply #14 on: January 17, 2008, 05:16:35 AM » |
|
Inlcuded the current list of issues people are having with C# plugins. Please anyone who still has problems (new ones or the ones listed here) post here and tell which ones so I can assess the seriousness of each issue.
|
|
|
|
|
Logged
|
|
|
|
|
vitalyb
|
 |
« Reply #15 on: February 12, 2008, 11:22:14 AM » |
|
Updated SDK and plugins - Main issues should be resolved. Please read News in first post.
|
|
|
|
|
Logged
|
|
|
|
|
tomos
|
 |
« Reply #16 on: February 12, 2008, 11:53:36 AM » |
|
Updated SDK and plugins - Main issues should be resolved. Please read News in first post.
great stuff Vitaly !! do you know should these plugins (your three) show in dcupdater? They're not showing here - so I'm unsure where to download?
|
|
|
|
|
Logged
|
|
|
|
|
|
|
Perry Mowbray
|
 |
« Reply #18 on: June 22, 2008, 03:25:49 AM » |
|
I'm having some simple startup issues Vitaly: For a quick start, you should copy one of the sample plugins, change the name and go slowly from there by deleting the parts you don't need. OK, I think I've changed names everywhere I need to? eg: added "Test_" to your FARRAltTab. But when building I get the following errors: - /OUT:FARRPluginRCW.dll directive in .EXP differs from output filename 'G:\Documents\My Development\FARR Plugins\CSharpSDK\FARR CSharp SDK\Debug\Test_FARRAltTabRCW.dll'; ignoring directive G:\Documents\My Development\FARR Plugins\CSharpSDK\Copy of FARRAltTab\Test_FARRAltTabRCW.exp Test_FARRAltTab
- /DELAYLOAD:OleAcc.dll ignored; no imports found from OleAcc.dll G:\Documents\My Development\FARR Plugins\CSharpSDK\Copy of FARRAltTab\LINK Test_FARRAltTab
- precompiled object not linked in; image may not run G:\Documents\My Development\FARR Plugins\CSharpSDK\Copy of FARRAltTab\JrPlugin_GenericShell.obj Test_FARRAltTab
- 1 unresolved externals G:\Documents\My Development\FARR Plugins\CSharpSDK\FARR CSharp SDK\Debug\Test_FARRAltTabRCW.dll Test_FARRAltTab
- The command ""G:\Documents\My Development\FARR Plugins\CSharpSDK\Copy of FARRAltTab\..\FARR CSharp SDK\FARRPluginRCW\ProjectNameChanger.exe" "G:\Documents\My Development\FARR Plugins\CSharpSDK\Copy of FARRAltTab\..\FARR CSharp SDK\FARRPluginRCW\FARRPluginRCW.vcproj" Test_FARRAltTabRCW
%windir%\Microsoft.NET\Framework\v2.0.50727\MSBuild.exe "G:\Documents\My Development\FARR Plugins\CSharpSDK\Copy of FARRAltTab\..\FARR CSharp SDK\FARRCSharpSDK.sln" xcopy /Y "G:\Documents\My Development\FARR Plugins\CSharpSDK\Copy of FARRAltTab\..\FARR CSharp SDK\debug\Test_FARRAltTabRCW.dll" "G:\Documents\My Development\FARR Plugins\CSharpSDK\Copy of FARRAltTab\"" exited with code 4. Test_FARRAltTab
What am I doing wrong??? 
|
|
|
|
|
Logged
|
|
|
|
|
fenixproductions
|
 |
« Reply #19 on: September 26, 2008, 08:08:51 AM » |
|
Is it working with VS 2008 Express editions? I have both, C# and C++ environments here but compilation always stops on "VCBuild.exe cannot be found" message.
It is strange because: 1. I have such file in my VS directory structure, 2. report says that I should have .NET farmework 2.x installed even if I have it.
|
|
|
|
|
Logged
|
Надо было учиться, а не камни в школу бросать...-- f0dder is my personal hero 
|
|
|
|
vitalyb
|
 |
« Reply #20 on: October 18, 2008, 05:55:57 PM » |
|
Is it working with VS 2008 Express editions? I have both, C# and C++ environments here but compilation always stops on "VCBuild.exe cannot be found" message. I only tried compiling with VS 2005. Try its express edition maybe?
|
|
|
|
|
Logged
|
|
|
|
|
vitalyb
|
 |
« Reply #21 on: October 18, 2008, 05:57:10 PM » |
|
I've uploaded a new version of the C# SDK. It now includes a simplified layer that allows more object oriented plugins to be created easily. Also, it now includes template for those that got a bit confused with the numerous post/pre build events and the whole integration process. Hopefully now it will just work  .
|
|
|
|
|
Logged
|
|
|
|
|
mouser
|
 |
« Reply #22 on: October 18, 2008, 06:05:42 PM » |
|
|
|
|
|
|
Logged
|
|
|
|
|
Perry Mowbray
|
 |
« Reply #23 on: November 16, 2008, 07:25:20 PM » |
|
Hi Vitaly: Windows is reporting tour zip file is invalid/corrupted: 
|
|
|
|
|
Logged
|
|
|
|
|
mouser
|
 |
« Reply #24 on: November 16, 2008, 07:38:56 PM » |
|
Perry -- i got same error as you; then i opened file in text editor and saw it was a .rar filel if you rename to .rar and have a program that can open .rar files it will open ok.
hopefully vitaly can repack as a zip later.
|
|
|
|
« Last Edit: November 16, 2008, 07:47:00 PM by mouser »
|
Logged
|
|
|
|
|