Click here to Skip to main content
15,900,378 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralCreating a resizable dialog in MFC Pin
Twonington11-Aug-05 3:39
Twonington11-Aug-05 3:39 
GeneralRe: Creating a resizable dialog in MFC Pin
Rory Solley11-Aug-05 22:21
Rory Solley11-Aug-05 22:21 
GeneralRe: Creating a resizable dialog in MFC Pin
Twonington11-Aug-05 23:06
Twonington11-Aug-05 23:06 
GeneralRe: Creating a resizable dialog in MFC Pin
pablo_mag16-Aug-05 14:21
pablo_mag16-Aug-05 14:21 
QuestionChanging the dialog's class name? Pin
hjm340910-Aug-05 18:23
hjm340910-Aug-05 18:23 
AnswerRe: Changing the dialog's class name? Pin
mark novak15-Aug-05 0:59
mark novak15-Aug-05 0:59 
GeneralSame Sink for different events Pin
AkshayO10-Aug-05 0:30
AkshayO10-Aug-05 0:30 
GeneralRe: Same Sink for different events Pin
Laxman Auti22-Mar-07 7:55
Laxman Auti22-Mar-07 7:55 
AkshayO wrote:
I am creating an com addin for Office using VC++. The project is ATL based. My question is how can I implement a common handler for a set of CommandBarButtons?


The sink map basically provides the mapping between a dispid that defines the event and the member function that handles it. Command button fires the event with dispid 0x01 so there is no need to setup sink map for every button.
BEGIN_SINK_MAP(CAddin)
SINK_ENTRY_INFO( 1,__uuidof(Office::_CommandBarButtonEvents),/*dispid*/ 0x01,OnClickButton,&OnClickButtonInfo)
END_SINK_MAP()
You can differentiate button's with the help of button value or caption.
void __stdcall CAddin::OnClickButton(
      IDispatch* /*Office::_CommandBarButton* */ Ctrl,
      VARIANT_BOOL * CancelDefault)
{
  USES_CONVERSION;
  CComQIPtr pCommandBarButton(Ctrl);
  MessageBox(NULL, "Clicked", "OnClickButton", MB_OK);
}


Knock out 't' from can't,
You can if you think you can
Cool | :cool:

Generalimplicit typename is deprecated Pin
xiaohe5219-Aug-05 16:14
xiaohe5219-Aug-05 16:14 
GeneralRe: implicit typename is deprecated Pin
xiaohe5219-Aug-05 16:26
xiaohe5219-Aug-05 16:26 
GeneralRe: implicit typename is deprecated Pin
Christian Graus9-Aug-05 16:33
protectorChristian Graus9-Aug-05 16:33 
GeneralRe: implicit typename is deprecated Pin
Roland Pibinger9-Aug-05 21:48
Roland Pibinger9-Aug-05 21:48 
Generalpassing array of string back ATL to VB and vice versa Pin
bluish8-Aug-05 18:50
bluish8-Aug-05 18:50 
GeneralRe: passing array of string back ATL to VB and vice versa Pin
Christian Graus9-Aug-05 16:34
protectorChristian Graus9-Aug-05 16:34 
GeneralRe: passing array of string back ATL to VB and vice versa Pin
Jörgen Sigvardsson9-Aug-05 22:11
Jörgen Sigvardsson9-Aug-05 22:11 
GeneralCrash in IE while using ActiveX dll Pin
Amit Mulay8-Aug-05 0:32
Amit Mulay8-Aug-05 0:32 
GeneralRe: Crash in IE while using ActiveX dll Pin
Amit Mulay8-Aug-05 0:59
Amit Mulay8-Aug-05 0:59 
GeneralRe: Crash in IE while using ActiveX dll Pin
Jörgen Sigvardsson9-Aug-05 22:17
Jörgen Sigvardsson9-Aug-05 22:17 
QuestionWorking on POST method with BHO? Pin
nmhuy7-Aug-05 17:40
nmhuy7-Aug-05 17:40 
Questionvector won't load. Why? Pin
Larry Mills Sr7-Aug-05 9:22
Larry Mills Sr7-Aug-05 9:22 
AnswerRe: vector won't load. Why? Pin
Steve S8-Aug-05 2:35
Steve S8-Aug-05 2:35 
GeneralRe: vector won't load. Why? Pin
Larry Mills Sr8-Aug-05 15:24
Larry Mills Sr8-Aug-05 15:24 
GeneralRe: vector won't load. Why? Pin
Steve S15-Aug-05 0:11
Steve S15-Aug-05 0:11 
GeneralRe: vector won't load. Why? Pin
Larry Mills Sr15-Aug-05 14:51
Larry Mills Sr15-Aug-05 14:51 
GeneralRe: vector won't load. Why? Pin
Steve S16-Aug-05 6:17
Steve S16-Aug-05 6:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.