Miranda IM

Page 7 of 7 FirstFirst ... 567
Results 61 to 68 of 68

Thread: Important Plugin Changes For Plugin Authors

  1. #61
    Join Date
    March 2005
    Posts
    9,533
    Make sure you declared MirandaPluginInfo Ex:
    Code:
    __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
    {
    	return &pluginInfo;
    }
    and your interface (can be MIID_MBOT):
    Code:
    static const MUUID interfaces[] = {MIID_CHAT, MIID_SRMM, MIID_LAST};
    __declspec(dllexport) const MUUID * MirandaPluginInterfaces(void)
    {
    	return interfaces;
    }

  2. #62
    Join Date
    September 2006
    Location
    DA-City (near ffm germany)
    Posts
    112
    I didn't aks for UUID's but for the interfaces but it is answered as well :)


    but line 171:
    static const MUUID interfaces[] = {MIID_MBOT, MIID_LAST};


    gives following compile errors (VS2008 if it matters):
    Error 1
    error C2065: 'MIID_MBOT' : undeclared identifier d:\_stuff\mbot_dev\mbotr\mbot_r11\src\mbot\mbot.cp p
    171 mbot

    Error 2
    error C2078: too many initializers d:\_stuff\mbot_dev\mbotr\mbot_r11\src\mbot\mbot.cp p
    171 mbot


    which is why I'm asking what MIID_ s are available as interfaces



    Code:

    static const MUUID interfaces[] = {MIID_CHAT, MIID_SRMM, MIID_LAST};
    __declspec(dllexport) const MUUID * MirandaPluginInterfaces(void)
    {
    return interfaces;
    }

    In the above example, the plugin declares that it implements 2 interfaces that are already defined in newpluginapi.h. MIID_LAST is always used to denote the end of the list. Every plugin must return atleast one interface (besides MIID_LAST). If their plugin implements an interface that isn't already defined in newpluginapi.h, then they need to create a new UUID to use.
    is just saying I need to generate an UUID by myself... so did I and what did I do wrong?

    or did I by any chance generate an UUID I can't use because it's taken? ( I think I tried 2 or 3 so statistically this really shouldn't be the case)



    -edit-

    It accept MIID_MBOT when I add it in the miranda headers file but that is not the rigth way to do it... is it?
    I can't tell everyone hey recompile your miranda to use this plugin...
    Last edited by sirion; 2 Dec 2008 at 10:04 PM.

  3. #63
    Join Date
    June 2005
    Posts
    11,839
    Well, I can debug it for you if you publish the code.

  4. #64
    Join Date
    March 2005
    Posts
    9,533
    I have added the required changes for SelfStatusNotify a while ago. You may compare the code below with the original one on the Addons, see what was needed.
    (If anyone's interested in this plugin's update, I could try contacting Denis and ask him to update the official version)

    main.c:
    Code:
    #include <windows.h>
    #include "../../include/newpluginapi.h"
    #include "../../include/m_system.h"
    #include "../../include/m_skin.h"
    #include "../../include/m_protomod.h"
    #include "../../include/m_protosvc.h"
    #include "../../include/m_langpack.h"
    
    //#include "AggressiveOptimize.h"
    
    HINSTANCE hInst;
    PLUGINLINK *pluginLink;
    HANDLE hProtoAck;
    BOOL isOld = 0;
    
    char szTitle[] = "Self status sound";
    
    PLUGININFOEX pluginInfo={
    sizeof( PLUGININFOEX ),
    	szTitle,
    	PLUGIN_MAKE_VERSION( 0,0,1,0 ),
    	"Now you will hear sound on your status changes",
    	"Denis Stanishevskiy // StDenis, UUID by Drugwash",
    	"stdenformiranda(at)fromru(dot)com [email protected]",
    	"Copyright (c) 2004, Denis Stanishevskiy",
    	"",
    	0,
    	0,
    	{ 0x9d8cf05a, 0xd5ed, 0x4f25, { 0x93, 0x82, 0xe6, 0x23, 0x7a, 0x8b, 0x6a, 0x6e } }
    // {9D8CF05A-D5ED-4f25-9382-E6237A8B6A6E}
    };
    
    PLUGININFO oldpluginInfo={
    sizeof( PLUGININFO ),
    	szTitle,
    	PLUGIN_MAKE_VERSION( 0,0,1,0 ),
    	"Now you will hear sound on your status changes",
    	"Denis Stanishevskiy // StDenis, UUID by Drugwash",
    	"stdenformiranda(at)fromru(dot)com [email protected]",
    	"Copyright (c) 2004, Denis Stanishevskiy",
    	"",
    	0,
    	0,
    };
    
    BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved)
    {
    	hInst=hinstDLL;
    	return TRUE;
    }
    
    #define MIID_SELFSTATUSSOUND { 0x9d8cf05a, 0xd5ed, 0x4f25, { 0x93, 0x82, 0xe6, 0x23, 0x7a, 0x8b, 0x6a, 0x6e } }
    
    __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
    {
    	static const MUUID interfaces[] = {MIID_SELFSTATUSSOUND, MIID_LAST};
    	return interfaces;
    }
    
    __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
    {
    	return &pluginInfo;
    }
    
    __declspec(dllexport) PLUGININFO* MirandaPluginInfo(DWORD mirandaVersion)
    {
    	isOld = mirandaVersion < PLUGIN_MAKE_VERSION(0,3,4,0);
    	return &oldpluginInfo;
    }
    
    int dwSkinSoundIndx[] =
    {
    	ID_STATUS_OFFLINE               ,
    	ID_STATUS_ONLINE                ,
    	ID_STATUS_AWAY                  ,
    	ID_STATUS_DND                   ,
    	ID_STATUS_NA                    ,
    	ID_STATUS_OCCUPIED              ,
    	ID_STATUS_FREECHAT              ,
    	ID_STATUS_INVISIBLE             ,
    	ID_STATUS_ONTHEPHONE            ,
    	ID_STATUS_OUTTOLUNCH            
    };
    char *szSkinSoundName[] =
    {
    	"SelfOffline",
    	"SelfOnline",
    	"SelfAway",
    	"SelfDND",
    	"SelfNA",
    	"SelfOccupied",
    	"SelfFreeForChat",
    	"SelfInvisible",
    	"SelfOnThePhone",
    	"SelfOutToLunch"
    };
    char *szSkinSoundInfo[] =
    {
    	"Offline",
    	"Online",
    	"Away",
    	"Do Not Disturb",
    	"Not Available",
    	"Occupied",
    	"Free For Chat",
    	"Invisible",
    	"On The Phone",
    	"Out To Lunch"
    };
    #define SOUND_COUNT	(sizeof(dwSkinSoundIndx)/sizeof(dwSkinSoundIndx[0]))
    static int ProtoAck(WPARAM wParam, LPARAM lParam)
    {
    	ACKDATA * ack = (ACKDATA*) lParam;
    	if ( ack != 0 && ack->szModule && ack->type == ACKTYPE_STATUS && ack->result == ACKRESULT_SUCCESS)
    	{
    		int indx;
    		for(indx = 0; indx < SOUND_COUNT; indx++)
    			if(dwSkinSoundIndx[indx] == ack->lParam)
    			{
    				char buf[128];
    				_snprintf(buf, sizeof(buf), "&#37;s%s", ack->szModule, szSkinSoundName[indx]);
    				SkinPlaySound(buf);
    				break;
    			}
    	}
    	return 0;
    }
    
    int ModulesLoaded(WPARAM wParam, LPARAM lParam)
    {
    	int protoCount=0, indx, jndx;
    	PROTOCOLDESCRIPTOR **protos = 0;
    	char infobuf[256], namebuf[128], protoName[64];
    
    	CallService(MS_PROTO_ENUMPROTOCOLS, (WPARAM)&protoCount, (LPARAM)&protos);
    	for(indx = 0; indx < protoCount; indx++)
    		if(protos[indx]->type == PROTOTYPE_PROTOCOL)
    		{
    			CallProtoService(protos[indx]->szName, PS_GETNAME, sizeof(protoName), (LPARAM)protoName);
    			for(jndx = 0; jndx < SOUND_COUNT; jndx++)
    			{
    				_snprintf(namebuf, sizeof(namebuf), "%s%s", protos[indx]->szName, szSkinSoundName[jndx]);
    				if(isOld)
    				{
    					_snprintf(infobuf, sizeof(infobuf), "%s [%s]: %s",
    						Translate("Self status"),
    						protoName,
    						Translate(szSkinSoundInfo[jndx]));
    					SkinAddNewSound(namebuf,infobuf, "");
    				}
    				else
    				{
    					_snprintf(infobuf, sizeof(infobuf), "%s [%s]",
    						Translate("Self status"),
    						protoName);
    					SkinAddNewSoundEx(namebuf,
    						infobuf,
    						Translate(szSkinSoundInfo[jndx]));
    				}
    			}
    		}
    
    	return 0;
    }
    
    int __declspec(dllexport) Load(PLUGINLINK *link)
    {
    	pluginLink=link;
    
    	hProtoAck = HookEvent(ME_PROTO_ACK, ProtoAck);
    	HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded);
    
    	return 0;
    }
    
    int __declspec(dllexport) Unload(void)
    {
    	UnhookEvent(hProtoAck);
    	return 0;
    }

  5. #65
    Join Date
    March 2005
    Posts
    8,345
    Quote Originally Posted by Drugwash View Post
    I have added the required changes for SelfStatusNotify a while ago. <snip>
    (If anyone's interested in this plugin's update, I could try contacting Denis and ask him to update the official version)
    That would be very kind of you. Many thanks in advance!

  6. #66
    Join Date
    June 2005
    Posts
    11,839
    Quote Originally Posted by sirion View Post
    It accept MIID_MBOT when I add it in the miranda headers file but that is not the rigth way to do it... is it?
    I can't tell everyone hey recompile your miranda to use this plugin...
    Just add MIID_MBOT to your header files, that's it.

  7. #67
    I know that Miranda is written in C, but still I would like to know... Could anyone tell me how should the core of a plugin look like in Delphi?

  8. #68
    Join Date
    April 2005
    Posts
    739
    There's already plugins written in Delphi.
    Use search.

Similar Threads

  1. [plugin request] Alternative Clist-PlugIn
    By nore2 in forum Feature Requests
    Replies: 1
    Last Post: 27 Dec 2007, 3:49 PM
  2. [plugin request] Send Screenshot plugin for 0.7.3
    By Melhesedek in forum Feature Requests
    Replies: 1
    Last Post: 23 Dec 2007, 3:35 PM
  3. Important Question about adding people plugin
    By shishkabab in forum Technical Support
    Replies: 3
    Last Post: 6 Oct 2007, 2:18 AM
  4. Plugin:Request - File Sharing plugin
    By Grimmy in forum Feature Requests
    Replies: 2
    Last Post: 12 Jan 2007, 3:56 AM
  5. help needed: miranda - plugin SK & CZ plugin developers
    By NuSuey in forum Technical Support
    Replies: 4
    Last Post: 5 Nov 2006, 5:47 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •