adding button or menu to outlook

S

soner

Hi all,

i have a code to add new button and menu to outlook toolbar. When i
use registry (HKLM/Software/Microsoft/Exchange/Client/Extension) for
adding my add-in, i can see my new menu. But if i use ecf file i can
add my add-in but i can not see my new menu. i am using c++ and
InsertMenu command for adding menu.

my ECF file ;

[General]
Display Name=MyExtension
Description=MyExtension
Path="C:\windows\system32\myExt.dll"
Entry Point=1
Client Version=4.0
Misc Flags=NoOptimizeInterfaceMap;MoreContexts;InstallCommandsEarly

[Exchange Client Compatibility]
Exchange Context Map=11111111111111
Exchange Interface Map=11111111

[Application]
Events=OnStartup;OnShutdown

[Session]
Events=OnLogon;OnLogoff;OnDelivery

[Property Sheet]
Events=AddPropSheetPages
Property Sheet Dialogs=ToolsOptions

[Folder]
Folder Class=IPF
Menu
Drops=File;Edit;View;Insert;Format;Tools;Compose;Help;Main;Toolbar;Contact;Calendar;Note;Task;Journal;FileFolder
Events=AllCommands;InstallCommands;AddPropSheetPages;Install;OnFolderChange;OnSelectionChange
Views=Viewer

[Item]
Message Class=IPM
Item States=Modal;NonModal;Read;Compose
Menu
Drops=File;Edit;View;Insert;Format;Tools;Compose;Help;Main;Toolbar;Contact;Calendar;Note;Task;Journal;FileFolder
Events=AllCommands;InstallCommands;OnItemChange;OnCommand

i can't find a detailed document about ecf file. please help me to
find the problem.

Thanks in advance.
 
D

Dmitry Streblechenko

what is your code? Does it get called?
I would seriously consider switching to a COM add-in if I were you...

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
 
S

soner

Hi Dimitry,

Thank you for your help.

This code should add menu to outlook main window and new mail.

STDMETHODIMP MyExchExtCommands::InstallCommands (LPEXCHEXTCALLBACK
lpeecb, HWND hwnd,
HMENU hmenu, UINT FAR * lpcmdidBase,
LPTBENTRY lptbeArray, UINT ctbe,
ULONG ulFlags)
{
HRESULT hr = S_OK;
HMENU hMenuMain = 0;
HMENU hmenuHelp = 0;
HMENU hMyMenu = 0;
ULONG nMenuPos = 0;
UINT flags = (MF_BYPOSITION | MF_STRING);

if (FAILED(hr = lpeecb->GetMenu(&hMenuMain))) {
return S_FALSE;
}

if (FAILED(hr = lpeecb->GetMenuPos(EECMDID_Help, &hmenuHelp,
&nMenuPos, NULL, 0))) {
return S_FALSE;
}

// g_context is a global variable getting from MyExchExt::Install
fonk.

if ((g_context == EECONTEXT_SENDNOTEMESSAGE) || (g_context ==
EECONTEXT_SENDRESENDMESSAGE))
{
if(!(hMyMenu = CreateMenu())){
return S_FALSE;
}

m_cmdidFirstMenu= (*lpcmdidBase)++;
m_cmdidSecondMenu = (*lpcmdidBase)++;

if(!(InsertMenu(hMenuMain, nMenuPos, MF_BYPOSITION | MF_POPUP,
(UINT)hMyMenu, "&MyMenu"))){
return S_FALSE;
}

if(!(InsertMenu(hMyMenu, 0, flags , m_cmdidFirstMenu, "&First
Member"))){
return S_FALSE;
}

InsertMenu(hMyMenu, 1, MF_BYPOSITION | MF_SEPARATOR, 0, NULL);

if(!(InsertMenu(hMyMenu, 2, MF_BYPOSITION | MF_STRING,
m_cmdidSecondMenu , "&Second Member"))){
return S_FALSE;
}
}

else if(g_context == EECONTEXT_VIEWER){
if(!(hMyMenu = CreateMenu())){
return S_FALSE;
}

m_cmdidMainMenu = (*lpcmdidBase)++;

if(!(InsertMenu(hMenuMain, nMenuPos, MF_BYPOSITION | MF_POPUP,
(UINT)hMyMenu, "&MyMenu"))){
return S_FALSE;
}

if(!(InsertMenu(hMyMenu, 0, flags , m_cmdidMainMenu, "Main
Member"))){
return S_FALSE;
}
}
return hr;
}

what is your code? Does it get called?
I would seriously consider switching to a COM add-in if I were you...

--
Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

i have a code to add new button and menu to outlook toolbar. When i
use registry (HKLM/Software/Microsoft/Exchange/Client/Extension) for
adding my add-in, i can see my new menu. But if i use ecf file i can
add my add-in but i can not see my new menu. i am using c++ and
InsertMenu command for adding menu.
my ECF file ;
[General]
Display Name=MyExtension
Description=MyExtension
Path="C:\windows\system32\myExt.dll"
Entry Point=1
Client Version=4.0
Misc Flags=NoOptimizeInterfaceMap;MoreContexts;InstallCommandsEarly
[Exchange Client Compatibility]
Exchange Context Map=11111111111111
Exchange Interface Map=11111111
[Application]
Events=OnStartup;OnShutdown
[Session]
Events=OnLogon;OnLogoff;OnDelivery

[Property Sheet]
Events=AddPropSheetPages
Property Sheet Dialogs=ToolsOptions
[Folder]
Folder Class=IPF
Menu
Drops=File;Edit;View;Insert;Format;Tools;Compose;Help;Main;Toolbar;Contact;Calendar;Note;Task;Journal;FileFolder
Events=AllCommands;InstallCommands;AddPropSheetPages;Install;OnFolderChange;OnSelectionChange
Views=Viewer
[Item]
Message Class=IPM
Item States=Modal;NonModal;Read;Compose
Menu
Drops=File;Edit;View;Insert;Format;Tools;Compose;Help;Main;Toolbar;Contact;Calendar;Note;Task;Journal;FileFolder
Events=AllCommands;InstallCommands;OnItemChange;OnCommand
i can't find a detailed document about ecf file. please help me to
find the problem.
Thanks in advance.
 
D

Dmitry Streblechenko

Does it actually get called when you run under the debugger?

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
Hi Dimitry,

Thank you for your help.

This code should add menu to outlook main window and new mail.

STDMETHODIMP MyExchExtCommands::InstallCommands (LPEXCHEXTCALLBACK
lpeecb, HWND hwnd,
HMENU hmenu, UINT FAR * lpcmdidBase,
LPTBENTRY lptbeArray, UINT ctbe,
ULONG ulFlags)
{
HRESULT hr = S_OK;
HMENU hMenuMain = 0;
HMENU hmenuHelp = 0;
HMENU hMyMenu = 0;
ULONG nMenuPos = 0;
UINT flags = (MF_BYPOSITION | MF_STRING);

if (FAILED(hr = lpeecb->GetMenu(&hMenuMain))) {
return S_FALSE;
}

if (FAILED(hr = lpeecb->GetMenuPos(EECMDID_Help, &hmenuHelp,
&nMenuPos, NULL, 0))) {
return S_FALSE;
}

// g_context is a global variable getting from MyExchExt::Install
fonk.

if ((g_context == EECONTEXT_SENDNOTEMESSAGE) || (g_context ==
EECONTEXT_SENDRESENDMESSAGE))
{
if(!(hMyMenu = CreateMenu())){
return S_FALSE;
}

m_cmdidFirstMenu= (*lpcmdidBase)++;
m_cmdidSecondMenu = (*lpcmdidBase)++;

if(!(InsertMenu(hMenuMain, nMenuPos, MF_BYPOSITION | MF_POPUP,
(UINT)hMyMenu, "&MyMenu"))){
return S_FALSE;
}

if(!(InsertMenu(hMyMenu, 0, flags , m_cmdidFirstMenu, "&First
Member"))){
return S_FALSE;
}

InsertMenu(hMyMenu, 1, MF_BYPOSITION | MF_SEPARATOR, 0, NULL);

if(!(InsertMenu(hMyMenu, 2, MF_BYPOSITION | MF_STRING,
m_cmdidSecondMenu , "&Second Member"))){
return S_FALSE;
}
}

else if(g_context == EECONTEXT_VIEWER){
if(!(hMyMenu = CreateMenu())){
return S_FALSE;
}

m_cmdidMainMenu = (*lpcmdidBase)++;

if(!(InsertMenu(hMenuMain, nMenuPos, MF_BYPOSITION | MF_POPUP,
(UINT)hMyMenu, "&MyMenu"))){
return S_FALSE;
}

if(!(InsertMenu(hMyMenu, 0, flags , m_cmdidMainMenu, "Main
Member"))){
return S_FALSE;
}
}
return hr;
}

what is your code? Does it get called?
I would seriously consider switching to a COM add-in if I were you...

--
Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

i have a code to add new button and menu to outlook toolbar. When i
use registry (HKLM/Software/Microsoft/Exchange/Client/Extension) for
adding my add-in, i can see my new menu. But if i use ecf file i can
add my add-in but i can not see my new menu. i am using c++ and
InsertMenu command for adding menu.
my ECF file ;
[General]
Display Name=MyExtension
Description=MyExtension
Path="C:\windows\system32\myExt.dll"
Entry Point=1
Client Version=4.0
Misc Flags=NoOptimizeInterfaceMap;MoreContexts;InstallCommandsEarly
[Exchange Client Compatibility]
Exchange Context Map=11111111111111
Exchange Interface Map=11111111
[Application]
Events=OnStartup;OnShutdown
[Session]
Events=OnLogon;OnLogoff;OnDelivery

[Property Sheet]
Events=AddPropSheetPages
Property Sheet Dialogs=ToolsOptions
[Folder]
Folder Class=IPF
Menu
Drops=File;Edit;View;Insert;Format;Tools;Compose;Help;Main;Toolbar;Contact;Calendar;Note;Task;Journal;FileFolder
Events=AllCommands;InstallCommands;AddPropSheetPages;Install;OnFolderChange;OnSelectionChange
Views=Viewer
[Item]
Message Class=IPM
Item States=Modal;NonModal;Read;Compose
Menu
Drops=File;Edit;View;Insert;Format;Tools;Compose;Help;Main;Toolbar;Contact;Calendar;Note;Task;Journal;FileFolder
Events=AllCommands;InstallCommands;OnItemChange;OnCommand
i can't find a detailed document about ecf file. please help me to
find the problem.
Thanks in advance.
 
S

soner

Yes it is called under the debugger and i don't get any failure. My
plugin is added succesfully and some other feature runs properly but
my menu and buttons can't be shown on outlook toolbar.

Does it actually get called when you run under the debugger?

--
Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

Hi Dimitry,

Thank you for your help.

This code should add menu to outlook main window and new mail.

STDMETHODIMP MyExchExtCommands::InstallCommands (LPEXCHEXTCALLBACK
lpeecb, HWND hwnd,
HMENU hmenu, UINT FAR * lpcmdidBase,
LPTBENTRY lptbeArray, UINT ctbe,
ULONG ulFlags)
{
HRESULT hr = S_OK;
HMENU hMenuMain = 0;
HMENU hmenuHelp = 0;
HMENU hMyMenu = 0;
ULONG nMenuPos = 0;
UINT flags = (MF_BYPOSITION | MF_STRING);

if (FAILED(hr = lpeecb->GetMenu(&hMenuMain))) {
return S_FALSE;

}

if (FAILED(hr = lpeecb->GetMenuPos(EECMDID_Help, &hmenuHelp,
&nMenuPos, NULL, 0))) {
return S_FALSE;

}

// g_context is a global variable getting from MyExchExt::Install
fonk.

if ((g_context == EECONTEXT_SENDNOTEMESSAGE) || (g_context ==
EECONTEXT_SENDRESENDMESSAGE))
{
if(!(hMyMenu = CreateMenu())){
return S_FALSE;

}

m_cmdidFirstMenu= (*lpcmdidBase)++;
m_cmdidSecondMenu = (*lpcmdidBase)++;

if(!(InsertMenu(hMenuMain, nMenuPos, MF_BYPOSITION | MF_POPUP,
(UINT)hMyMenu, "&MyMenu"))){
return S_FALSE;

}

if(!(InsertMenu(hMyMenu, 0, flags , m_cmdidFirstMenu, "&First
Member"))){
return S_FALSE;

}

InsertMenu(hMyMenu, 1, MF_BYPOSITION | MF_SEPARATOR, 0, NULL);

if(!(InsertMenu(hMyMenu, 2, MF_BYPOSITION | MF_STRING,
m_cmdidSecondMenu , "&Second Member"))){
return S_FALSE;

}
}

else if(g_context == EECONTEXT_VIEWER){
if(!(hMyMenu = CreateMenu())){
return S_FALSE;

}

m_cmdidMainMenu = (*lpcmdidBase)++;

if(!(InsertMenu(hMenuMain, nMenuPos, MF_BYPOSITION | MF_POPUP,
(UINT)hMyMenu, "&MyMenu"))){
return S_FALSE;

}

if(!(InsertMenu(hMyMenu, 0, flags , m_cmdidMainMenu, "Main
Member"))){
return S_FALSE;

}
}
return hr;
}

what is your code? Does it get called?
I would seriously consider switching to a COM add-in if I were you...
--
Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
Hi all,
i have a code to add new button and menu to outlook toolbar. When i
use registry (HKLM/Software/Microsoft/Exchange/Client/Extension) for
adding my add-in, i can see my new menu. But if i use ecf file i can
add my add-in but i can not see my new menu. i am using c++ and
InsertMenu command for adding menu.
my ECF file ;
[General]
Display Name=MyExtension
Description=MyExtension
Path="C:\windows\system32\myExt.dll"
Entry Point=1
Client Version=4.0
Misc Flags=NoOptimizeInterfaceMap;MoreContexts;InstallCommandsEarly
[Exchange Client Compatibility]
Exchange Context Map=11111111111111
Exchange Interface Map=11111111
[Application]
Events=OnStartup;OnShutdown
[Session]
Events=OnLogon;OnLogoff;OnDelivery
[Property Sheet]
Events=AddPropSheetPages
Property Sheet Dialogs=ToolsOptions
[Folder]
Folder Class=IPF
Menu
Drops=File;Edit;View;Insert;Format;Tools;Compose;Help;Main;Toolbar;Contact;Calendar;Note;Task;Journal;FileFolder
Events=AllCommands;InstallCommands;AddPropSheetPages;Install;OnFolderChange;OnSelectionChange
Views=Viewer
[Item]
Message Class=IPM
Item States=Modal;NonModal;Read;Compose
Menu
Drops=File;Edit;View;Insert;Format;Tools;Compose;Help;Main;Toolbar;Contact;Calendar;Note;Task;Journal;FileFolder
Events=AllCommands;InstallCommands;OnItemChange;OnCommand
i can't find a detailed document about ecf file. please help me to
find the problem.
Thanks in advance.
 
D

Dmitry Streblechenko

I don't know, sorry - it's been at elast 5 years sinc I used ECE API to
insert menu items.
I used OOM even from an ECE to do any UI related functionality.

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
Yes it is called under the debugger and i don't get any failure. My
plugin is added succesfully and some other feature runs properly but
my menu and buttons can't be shown on outlook toolbar.

Does it actually get called when you run under the debugger?

--
Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

Hi Dimitry,

Thank you for your help.

This code should add menu to outlook main window and new mail.

STDMETHODIMP MyExchExtCommands::InstallCommands (LPEXCHEXTCALLBACK
lpeecb, HWND hwnd,
HMENU hmenu, UINT FAR * lpcmdidBase,
LPTBENTRY lptbeArray, UINT ctbe,
ULONG ulFlags)
{
HRESULT hr = S_OK;
HMENU hMenuMain = 0;
HMENU hmenuHelp = 0;
HMENU hMyMenu = 0;
ULONG nMenuPos = 0;
UINT flags = (MF_BYPOSITION | MF_STRING);

if (FAILED(hr = lpeecb->GetMenu(&hMenuMain))) {
return S_FALSE;

}

if (FAILED(hr = lpeecb->GetMenuPos(EECMDID_Help, &hmenuHelp,
&nMenuPos, NULL, 0))) {
return S_FALSE;

}

// g_context is a global variable getting from MyExchExt::Install
fonk.

if ((g_context == EECONTEXT_SENDNOTEMESSAGE) || (g_context ==
EECONTEXT_SENDRESENDMESSAGE))
{
if(!(hMyMenu = CreateMenu())){
return S_FALSE;

}

m_cmdidFirstMenu= (*lpcmdidBase)++;
m_cmdidSecondMenu = (*lpcmdidBase)++;

if(!(InsertMenu(hMenuMain, nMenuPos, MF_BYPOSITION | MF_POPUP,
(UINT)hMyMenu, "&MyMenu"))){
return S_FALSE;

}

if(!(InsertMenu(hMyMenu, 0, flags , m_cmdidFirstMenu, "&First
Member"))){
return S_FALSE;

}

InsertMenu(hMyMenu, 1, MF_BYPOSITION | MF_SEPARATOR, 0, NULL);

if(!(InsertMenu(hMyMenu, 2, MF_BYPOSITION | MF_STRING,
m_cmdidSecondMenu , "&Second Member"))){
return S_FALSE;

}
}

else if(g_context == EECONTEXT_VIEWER){
if(!(hMyMenu = CreateMenu())){
return S_FALSE;

}

m_cmdidMainMenu = (*lpcmdidBase)++;

if(!(InsertMenu(hMenuMain, nMenuPos, MF_BYPOSITION | MF_POPUP,
(UINT)hMyMenu, "&MyMenu"))){
return S_FALSE;

}

if(!(InsertMenu(hMyMenu, 0, flags , m_cmdidMainMenu, "Main
Member"))){
return S_FALSE;

}
}
return hr;
}

what is your code? Does it get called?
I would seriously consider switching to a COM add-in if I were you...
--
Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
Hi all,
i have a code to add new button and menu to outlook toolbar. When i
use registry (HKLM/Software/Microsoft/Exchange/Client/Extension) for
adding my add-in, i can see my new menu. But if i use ecf file i can
add my add-in but i can not see my new menu. i am using c++ and
InsertMenu command for adding menu.
my ECF file ;
[General]
Display Name=MyExtension
Description=MyExtension
Path="C:\windows\system32\myExt.dll"
Entry Point=1
Client Version=4.0
Misc Flags=NoOptimizeInterfaceMap;MoreContexts;InstallCommandsEarly
[Exchange Client Compatibility]
Exchange Context Map=11111111111111
Exchange Interface Map=11111111
[Application]
Events=OnStartup;OnShutdown
[Session]
Events=OnLogon;OnLogoff;OnDelivery
[Property Sheet]
Events=AddPropSheetPages
Property Sheet Dialogs=ToolsOptions
[Folder]
Folder Class=IPF
Menu
Drops=File;Edit;View;Insert;Format;Tools;Compose;Help;Main;Toolbar;Contact;Calendar;Note;Task;Journal;FileFolder
Events=AllCommands;InstallCommands;AddPropSheetPages;Install;OnFolderChange;OnSelectionChange
Views=Viewer
[Item]
Message Class=IPM
Item States=Modal;NonModal;Read;Compose
Menu
Drops=File;Edit;View;Insert;Format;Tools;Compose;Help;Main;Toolbar;Contact;Calendar;Note;Task;Journal;FileFolder
Events=AllCommands;InstallCommands;OnItemChange;OnCommand
i can't find a detailed document about ecf file. please help me to
find the problem.
Thanks in advance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top