From 294826733381a5123401b656c315f5626bdfbed0 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Thu, 3 Dec 2015 19:43:16 +0000 Subject: MirLua: fix menu uid loading git-svn-id: http://svn.miranda-ng.org/main/trunk@15819 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/MirLua/src/m_genmenu.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/plugins/MirLua/src/m_genmenu.cpp b/plugins/MirLua/src/m_genmenu.cpp index 619925891e..64ff383ac6 100644 --- a/plugins/MirLua/src/m_genmenu.cpp +++ b/plugins/MirLua/src/m_genmenu.cpp @@ -15,7 +15,7 @@ void MakeMenuItem(lua_State *L, CMenuItem &mi) lua_pushliteral(L, "Uid"); lua_gettable(L, -2); const char* uuid = (char*)lua_tostring(L, -1); - if (uuid == NULL || CLSIDFromString((LPCOLESTR)ptrT(mir_utf8decodeT(uuid)), (LPCLSID)&mi.uid) != NOERROR) + if (UuidFromStringA((RPC_CSTR)uuid, (UUID*)&mi.uid)) UNSET_UID(mi); lua_pop(L, 1); @@ -142,12 +142,19 @@ static luaL_Reg genmenuApi[] = { "CheckMenuItem", lua_CheckMenuItem }, { "RemoveMenuItem", lua_RemoveMenuItem }, + { "MO_MAIN", NULL }, + { "MO_CONTACT", NULL }, + { NULL, NULL } }; LUAMOD_API int luaopen_m_genmenu(lua_State *L) { luaL_newlib(L, genmenuApi); + lua_pushinteger(L, MO_MAIN); + lua_setfield(L, -2, "MO_MAIN"); + lua_pushinteger(L, MO_CONTACT); + lua_setfield(L, -2, "MO_CONTACT"); return 1; } -- cgit v1.2.3