Click here to Skip to main content
16,013,918 members
Home / Discussions / COM
   

COM

 
QuestionCOM+ singleton ? Pin
Adrian Bacaianu11-Sep-02 1:42
Adrian Bacaianu11-Sep-02 1:42 
AnswerRe: COM+ singleton ? Pin
Anonymous_Besmel11-Sep-02 19:00
sussAnonymous_Besmel11-Sep-02 19:00 
AnswerRe: COM+ singleton ? Pin
Bart Robeyns17-Sep-02 5:13
Bart Robeyns17-Sep-02 5:13 
GeneralIGlobalInterfaceTable Pin
pépé10-Sep-02 22:53
pépé10-Sep-02 22:53 
GeneralRe: IGlobalInterfaceTable Pin
pépé10-Sep-02 23:35
pépé10-Sep-02 23:35 
GeneralDCOM security Pin
Mad Dog10-Sep-02 4:35
Mad Dog10-Sep-02 4:35 
GeneralHELP HELP HELP!!!! Pin
Anonymous9-Sep-02 7:21
Anonymous9-Sep-02 7:21 
GeneralRe: HELP HELP HELP!!!! Pin
Amit Dey11-Sep-02 11:49
Amit Dey11-Sep-02 11:49 
Please check out htis article :http://www.codeproject.com/com/outlookaddin.asp. Although this uses ATL, the basics still hold true.

You should use ConnectionPoints semantics to Advise and Unadvise to ICommandBarButtonEvents dispinterface which has a single method Click(dispid 0x00000001). Thus in your implementation of Invoke in your class, when the dispid = 1, check if the passed CommandBarButton* is the button you created and write the code for the handler.

First ofcourse somewhere in OnConnection() you must advise to ICommandBarButtonEvents like.

CComPtr<iconnectionpoint> spConPt;
hr = spMyButton->FindConnectionPoint(
DIID__CommandBarButtonEvents,
&spConPt);
DWORD dwCookie;
if (FAILED(hr))
return hr;
hr = spConPt->Advise(reinterpret_cast <idispatch*>(this),
&dwCookie4);
if (FAILED(hr))
return hr;

.......



similarly you should also Unadvise() when the connection is no longer needed.




'My capacity for happiness', he added, 'you could fit into a matchbox without taking out the matches first'.

- Marvin, the robot.

Amit Dey

sonork:
100:18407
msn: visualcdev


GeneralOffice 2000 Pin
Anonymous8-Sep-02 6:27
Anonymous8-Sep-02 6:27 
GeneralRe: Office 2000 Pin
Tym!11-Sep-02 5:54
Tym!11-Sep-02 5:54 
GeneralRe: Office 2000 Pin
Anonymous11-Sep-02 7:42
Anonymous11-Sep-02 7:42 
GeneralDCOM and COM and COM+ oh my.. Pin
TigerNinja_4-Sep-02 12:55
TigerNinja_4-Sep-02 12:55 
QuestionWord Automation working but doing something VERY STRANGE when opening file??? Pin
Al_Pennyworth4-Sep-02 2:58
Al_Pennyworth4-Sep-02 2:58 
AnswerRe: Word Automation working but doing something VERY STRANGE when opening file??? Pin
Tym!11-Sep-02 6:04
Tym!11-Sep-02 6:04 
GeneralRe: Word Automation working but doing something VERY STRANGE when opening file??? Pin
Anonymous11-Sep-02 7:43
Anonymous11-Sep-02 7:43 
Generalc++ COM client for ICollectionXXX / IEnumXXX properties Pin
magicbassfr3-Sep-02 4:59
magicbassfr3-Sep-02 4:59 
GeneralRe: c++ COM client for ICollectionXXX / IEnumXXX properties Pin
Ernest Laurentin3-Sep-02 9:12
Ernest Laurentin3-Sep-02 9:12 
GeneralRe: c++ COM client for ICollectionXXX / IEnumXXX properties Pin
magicbassfr3-Sep-02 21:35
magicbassfr3-Sep-02 21:35 
GeneralRe: c++ COM client for ICollectionXXX / IEnumXXX properties Pin
magicbassfr4-Sep-02 4:42
magicbassfr4-Sep-02 4:42 
GeneralIDL Blues Pin
Jeremy Pullicino2-Sep-02 22:39
Jeremy Pullicino2-Sep-02 22:39 
GeneralRe: IDL Blues Pin
Ernest Laurentin3-Sep-02 6:37
Ernest Laurentin3-Sep-02 6:37 
GeneralAutomation Properties Pin
[James Pullicino]2-Sep-02 2:15
[James Pullicino]2-Sep-02 2:15 
GeneralIShellLink creation fails Pin
CaesarCZ31-Aug-02 15:00
CaesarCZ31-Aug-02 15:00 
GeneralRe: IShellLink creation fails Pin
Todd Smith2-Sep-02 15:49
Todd Smith2-Sep-02 15:49 
GeneralRe: IShellLink creation fails Pin
Jeremy Pullicino2-Sep-02 22:36
Jeremy Pullicino2-Sep-02 22:36 

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.