From 35d5b1cc47ac444524c087615033d5856f8a5dc3 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 10 Apr 2025 16:45:33 +0300 Subject: no need to declare the same template in each protocol --- include/m_protoint.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include') diff --git a/include/m_protoint.h b/include/m_protoint.h index fff60ea614..4d3a908168 100644 --- a/include/m_protoint.h +++ b/include/m_protoint.h @@ -330,6 +330,13 @@ template struct PROTO : public PROTO_INTERFACE typedef INT_PTR(MIR_CDECL T::*MyServiceFuncParam)(WPARAM, LPARAM, LPARAM); __forceinline void CreateProtoServiceParam(const char *name, MyServiceFuncParam pFunc, LPARAM param) { ::ProtoCreateServiceParam(this, name, (ProtoServiceFuncParam)pFunc, param); } + + template + static INT_PTR MIR_CDECL GlobalService(WPARAM hContact, LPARAM lParam) + { + T *proto = CMPlugin::getInstance((MCONTACT)hContact); + return proto ? (proto->*MyGlobalService)(hContact, lParam) : 0; + } }; ///////////////////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3