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

COM

 
GeneralOpen Saved Document Pin
11-Sep-02 7:55
suss11-Sep-02 7:55 
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 
I am having some trouble with something that is probably very simple. I have a COM project (exe) and it does not use any ATL. It is fairly simple, a dialog box opens with 2 buttons, the first is to run MS Word. When pressed, word opens up and the user can enter some text. After a lot of research and trial-and-error, I was able to put a button on the Word toolbar. But I do not know how to know when the button has been pressed. This is my class:

/*----------------------------------------------------------------------------*/

const IID IID_IWordAppEventSink = __uuidof(Word::ApplicationEvents);
const IID IID_IWordDocEventSink = __uuidof(Word::DocumentEvents);
const IID IID_ISpecialSaveExit = __uuidof(Office::CommandBarButton);

/*----------------------------------------------------------------------------*/

class CWordEventSink : public CCmdTarget
{
DECLARE_DYNCREATE(CWordEventSink)

public:
CWordEventSink();
virtual ~CWordEventSink();
BOOL Advise(IUnknown* pSource, REFIID iid);
BOOL Unadvise(REFIID iid);
void SetLauncher(CTestDlg* pWordLauncher);

// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CWordEventSink)
public:
virtual void OnFinalRelease();
//}}AFX_VIRTUAL

protected:

// Generated message map functions
//{{AFX_MSG(CWordEventSink)
// NOTE - the ClassWizard will add and remove member functions here.
//}}AFX_MSG

DECLARE_MESSAGE_MAP()
// Generated OLE dispatch map functions
//{{AFX_DISPATCH(CWordEventSink)
afx_msg void OnAppStartup();
afx_msg void OnAppQuit();
afx_msg void OnAppDocumentChange();
afx_msg void OnDocNew();
afx_msg void OnDocOpen();
afx_msg void OnDocClose();
afx_msg void PSISaveAndExit();
//}}AFX_DISPATCH
DECLARE_DISPATCH_MAP()
DECLARE_INTERFACE_MAP()

private:
CConnectionAdvisor m_AppEventsAdvisor;
CConnectionAdvisor m_DocEventsAdvisor;
CConnectionAdvisor m_BarEventsAdvisor;
CTestDlg* m_pWordLauncher;
};

I kind of cheated by using an example article written by Christian Staffe called Automating and Eventing in Word. But it never mentioned what to do to capture when the button has been pressed. Does anyone have any thoughts or suggestions? Examples would be great to, I am still trying to learn all this COM stuff..........


GeneralRe: HELP HELP HELP!!!! Pin
Amit Dey11-Sep-02 11:49
Amit Dey11-Sep-02 11:49 
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 

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.