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