What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Plug-Ins » self-made Dll Plugin load failure C++

self-made Dll Plugin load failure C++
Author: Message:
Quintok
New Member
*


Posts: 3
Joined: Nov 2004
O.P. self-made Dll Plugin load failure C++
Hi, I'm new to Dlls so I'm almost 100% sure this is my fault, however I'm unable to see why this Dll does not load into MsgPlus.  I've tried to emulate the MPPluginC sample from MPPlugins (which loaded fine - even after I recompiled it) however for a reason I cannot see it won't load.

I have turned off precompiled headers and it compiles fine.
Thanks.

here's the code.
code:
#include "stdafx.h" // loads <tchar.h> <comdef.h> & <windows.h>
#include "MPPluginHeader.h"

//////////////////////////////////////////////////////////////////////
//                                                                    //
// Purpose: DLL Entry Point                                            //
//                                                                    //
//////////////////////////////////////////////////////////////////////
BOOL APIENTRY DllMain(HANDLE hModule, DWORD nReason, void* pReserved)
{
    return TRUE;
}

//////////////////////////////////////////////////////////////////////
//                                                                    //
// Purpose: Initialization function                                    //
//                                                                    //
//////////////////////////////////////////////////////////////////////
MPPLUGIN_RETURN_BOOL Initialize(/*[in]*/ DWORD nVersion,
                                /*[in]*/ const char* sUserEmail,
                                /*[in]*/ IDispatch* iMessengerObj)
{
    char crap[256]; crap[255] = '\0';
    strcpy( crap, "Email: " );
    strcat( crap, sUserEmail );
    MessageBox(GetActiveWindow(), crap,
        "About Sample in C...", MB_OK);
    return TRUE;
}

//////////////////////////////////////////////////////////////////////
//                                                                    //
// Purpose: Uninitialization function                                //
//                                                                    //
//////////////////////////////////////////////////////////////////////
MPPLUGIN_RETURN_VOID Uninitialize()
{
}

//////////////////////////////////////////////////////////////////////
//                                                                    //
// Purpose: Configuration/Information function                        //
//                                                                    //
//////////////////////////////////////////////////////////////////////
MPPLUGIN_RETURN_VOID Configure()
{
    MessageBox(GetActiveWindow(), "Sample plugin made in language C\nAuthor: Patchou",
        "About Sample in C...", MB_OK);
}

//////////////////////////////////////////////////////////////////////
//                                                                    //
// Purpose: Inform the users about the features of the plugin        //
//                                                                    //
//////////////////////////////////////////////////////////////////////
MPPLUGIN_RETURN_BOOL PublishInfo(/*[out]*/ char *sPluginName,
                                 /*[out]*/ PLUGIN_PUBLISH_LIST* aCommands,
                                 /*[out]*/ PLUGIN_PUBLISH_LIST* aTags)
{
    // Plugin Name
    strcpy(sPluginName, "MsgPlusTest");

    // Commands Help
    aCommands->nCount = 1;
    strcpy(aCommands->sName[0], "Displays the Parameter");
    strcpy(aCommands->sValue[0], "xtest");
    strcpy(aCommands->sHelp[0], "any text");

    // Tags Help
    aTags->nCount = 0;

    return TRUE;
}

//////////////////////////////////////////////////////////////////////
//                                                                    //
// Purpose: Provide new commands in Messenger Plus!                    //
//                                                                    //
//////////////////////////////////////////////////////////////////////
MPPLUGIN_RETURN_BOOL ParseCommand(/*[in]*/  const char* sCommand,
                                  /*[in]*/  const char* sCommandArg,
                                  /*[in]*/  PLUGIN_PARAM* pParam,
                                  /*[out]*/ char* sResult)
{
    if(stricmp(sCommand, "/xtest") == 0)
    {
        char sMessage[256]; sMessage[255] = '0';
        strcpy( sMessage, "Arg: " );
        strcat( sMessage, sCommandArg );

        DisplayToast( sMessage, "Test", "http://www.google.com", 0 );
        strcpy( sResult, "" );
        return TRUE;
    }
    return FALSE;
}

//////////////////////////////////////////////////////////////////////
//                                                                    //
// Purpose: Provide new tags in Messenger Plus!                        //
//                                                                    //
//////////////////////////////////////////////////////////////////////
MPPLUGIN_RETURN_BOOL ParseTag(/*[in]*/  const char* sTag,
                              /*[in]*/  PLUGIN_PARAM* pParam,
                              /*[out]*/ char* sResult)
{
    return FALSE;
}

//////////////////////////////////////////////////////////////////////
//                                                                    //
// Purpose: Allow special actions when a plugin text is received    //
//                                                                    //
//////////////////////////////////////////////////////////////////////
MPPLUGIN_RETURN_BOOL ReceiveNotify(/*[in]*/  const char* sNotifyCode,
                                   /*[in]*/  const char* sText,
                                   /*[in]*/  PLUGIN_PARAM* pParam,
                                   /*[out]*/ char* sTextToSend)
{
    return FALSE;
}

Update:
in the DllMain I placed in a MessageBox, which pops up 3 times but the Initialize method is not executed.
after searching through the differences in setup between the example and what I wrote... I found that the .deb file was required for it to link into msgplus correctly.  knew it was my fault ;)
11-05-2004 12:14 PM
Profile E-Mail PM Find Quote Report
« 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