What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Plug-Ins » Programming with C#

Pages: (2): « First [ 1 ] 2 » Last »
1 votes - 5 average   Programming with C#
Author: Message:
white-knight
New Member
*


Posts: 2
Joined: Oct 2004
O.P. Programming with C#
Does anyone write plugins in microsoft visual c# .NET?
If so would I be able to get ahold of the source code, I would like to learn and have beginners knowlege of c# but i havent quite figured out this plugin stuff yet
06-02-2005 02:16 AM
Profile PM Find Quote Report
Patchou
Messenger Plus! Creator
*****

Avatar

Posts: 8607
Reputation: 201
43 / Male / Flag
Joined: Apr 2002
RE: Programming with C#
The plugins package includes a sample in VB.NET... it should be fairly easy to translate it into C# :).
[Image: signature2.gif]
06-02-2005 03:27 AM
Profile PM Web Find Quote Report
J-Thread
Full Member
***

Avatar

Posts: 467
Reputation: 8
– / Male / –
Joined: Jul 2004
RE: Programming with C#
I'm also trying to do it. Translate the other plugins to C# wasn't a problem. I've got this:

code:
using System;

namespace Test
{
    public class TestPlugin
    {
        public TestPlugin()
        {

        }

        public bool Initialize(long nVersion, string sUserEmail, object oMessenger)
        {
            return true;
        }

        public bool GetPublishInfo(ref string sPluginNameString, ref long nCommandCount, ref long nTagCount)
        {
            sPluginNameString = "Test Plugin";
            nCommandCount = 1;
            nTagCount = 0;
            return true;
        }

        public void GetPublishCommandInfo(long nCommandIdx, ref string sName, ref string sValue, ref string sHelp)
        {
            if(nCommandIdx == 1)
            {
                sName = "Test option";
                sValue = "xtest";
                sHelp = "Some help text";
            }
        }

        public void GetPublishTagInfo(long nTagIdx, ref string sName, ref string sValue)
        {

        }

        public bool ParseCommand(string sCommand, string sCommandArg, object oConversationWnd, ref string sResult)
        {
            if(sCommand.ToLower() == "/xtest")
            {
                sResult = "It works! You said: " + sCommandArg;
                return true;
            }

            return false;
        }
    }
}

But the problem is installing... I can't install it correctly...

I know how to do it but it doesn't work... I first unload the messenger plugins, then I copy the dll to the correct map, after that i write the registry key and then I use RegAsm to register my key. But i keep having errors about having 2 instances of mscoree.dll (or something like that) loaded... And msn crashes. One time it worked when I closed msn first, but that doesn't work all the time. I think the problem is, it takes too long to copy the dll and regasm it, so msgplus has already loaded it... But i'm not quite sure. Anybody has got an idea?
06-02-2005 12:09 PM
Profile E-Mail PM Find Quote Report
RaceProUK
Elite Member
*****

Avatar

Posts: 6073
Reputation: 57
39 / Male / Flag
Joined: Oct 2003
RE: Programming with C#
If it works when you close Messenger before doing all the copy+reg schniz, then why not keep doing that? It may annoy your contacts a bit, but then you can have your main profile on WebMessenger, and a second profile on MSN Messenger.
[Image: spartaafk.png]
06-02-2005 01:48 PM
Profile PM Web Find Quote Report
J-Thread
Full Member
***

Avatar

Posts: 467
Reputation: 8
– / Male / –
Joined: Jul 2004
RE: Programming with C#
But it should work while msn is running! How do people do it...
06-02-2005 04:32 PM
Profile E-Mail PM Find Quote Report
(CyBeRDuDe)
Senior Member
****


Posts: 512
Reputation: 21
37 / Male / –
Joined: Jul 2003
RE: Programming with C#
What reloader are you using?... If you use Plugin Reload By TheBlasphemer it unloads the plugins, then gives you a messagebox and the plugins will first be reloaded WHENl you click the ok botton on that messagebox.. this way you can be sure that there is time enough... If this still doesn't work then the timing is correct... Do you have any other plugins installed?.. Some plugins might crash Messenger when using a reloader, I'm still not sure why, but some does.. You will then have to follow this advise that Optimism gave in another thread:

quote:
Originally posted by optimism_
all it does is tells messenger plus! to reload the plugins using the information in the API.

If messenger crashes it is because one or more of the plugins dies. Therefore, you gotta do try each dll out, see which one causes the error.

rename ALL dlls except pluginreloader.dll to .dl.bak.
then reload
then rename ONE dll at a time back to .dll and reload again

When messenger crashes, the dll that you just renamed is the one that isnt working properly. You should upgrade or delete this plugin.
quote:
Originally posted by optimism_
presumably when it crashes itll be no longer running. therefore you can name them all to .bak before you restart it

{
Then rename a .bak to a .dll (they wont be locked at this point will they)
And reload
}//Repeat until the culpret is  found


Hope this will work for you?
06-02-2005 07:55 PM
Profile E-Mail PM Find Quote Report
RaceProUK
Elite Member
*****

Avatar

Posts: 6073
Reputation: 57
39 / Male / Flag
Joined: Oct 2003
RE: Programming with C#
quote:
Originally posted by (CyBeRDuDe)
Some plugins might crash Messenger when using a reloader, I'm still not sure why, but some does..
It depends on what they do, and whether they unload themselves properly. I know for certain that if you don't unsubclass a subclassed window, when the plugin is unloaded, MSN crashes as it tries to call a function that's no longer there.
[Image: spartaafk.png]
06-02-2005 09:31 PM
Profile PM Web Find Quote Report
J-Thread
Full Member
***

Avatar

Posts: 467
Reputation: 8
– / Male / –
Joined: Jul 2004
RE: Programming with C#
Tnx, i'll try that one!! I'm not using that reloader, i just broadcast "MessengerPlus_PluginChange". I'm almost sure it works, because when i don't send it, nothing happens because the new plugin isn't loaded untill i restart msn... Hmmm maybe first copy the dll, register it, and after that sending the windows message?

By the way, i'm using 2 plugins, the handwriting plugin (an old version i think, but it works correctly) and the Reverse Plugin made by myself (http://www.msgplus.net/pluginsdb/down/pafiledb.php?action=file&id=85). That may be the point, it is made in VB6... So that might be the old dll... I will try it tomorrow!! Tnx for your answers. When it all works properly i will post my Inno Setup code here also... Make a tutorial.
Maybe it's an idea to include an Inno Script example in the messenger plus plugin api? It will be usefull for beginning programmers i think... For those who don't know Inno Setup, see http://www.innosetup.com. It's the best setup you can have I think, you can do everything you want!! :D
I did a few tests today, and the problem is not the other plugins. It acts exactly the same when there are no other plugins...

But there should be anybody who made a proper setup for a VB.NET or C#.NET plugin don't you guys think?? By the way, it doesn't work anymore when I close MSN first... As soon as I start msn it gives an error about two different copy's of a dll...

I searched the forums and there is somebody who had about the same problem, he talked about "two versions of the .NET framework". Well i only got one version as far as I know, and that's 1.1....

Is there nobody who know a solution for this problem?
06-02-2005 10:40 PM
Profile E-Mail PM Find Quote Report
RaceProUK
Elite Member
*****

Avatar

Posts: 6073
Reputation: 57
39 / Male / Flag
Joined: Oct 2003
RE: Programming with C#
Make sure you haven't accidentally registered the DLL in two different locations.

Edit: What DLL is it complaining there's two copies of?

This post was edited on 06-03-2005 at 03:51 PM by RaceProUK.
[Image: spartaafk.png]
06-03-2005 03:51 PM
Profile PM Web Find Quote Report
J-Thread
Full Member
***

Avatar

Posts: 467
Reputation: 8
– / Male / –
Joined: Jul 2004
RE: Programming with C#
I made a new project in C#.NET, copy'd the code, changed all the names, then close msn, and execute the setup. It still gives an error, so it's not registered twice, that isn't possible because I just made it and haven't done anything else with it...

In the attachment the error i get when i start msn after installing...

[Image: attachment.php?pid=474051]

.gif File Attachment: msnfout.gif (14.81 KB)
This file has been downloaded 538 time(s).

This post was edited on 06-05-2005 at 08:17 AM by J-Thread.
06-04-2005 07:07 PM
Profile E-Mail PM Find Quote Report
Pages: (2): « First [ 1 ] 2 » Last »
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On