Click here to Skip to main content
15,924,367 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralInvalid OLEVERB structure Pin
Ryan Cromwell9-Sep-02 7:45
Ryan Cromwell9-Sep-02 7:45 
GeneralSending email Pin
dsfasdfadsfasdfadsf9-Sep-02 7:43
dsfasdfadsfasdfadsf9-Sep-02 7:43 
GeneralRe: Sending email Pin
Chris Losinger9-Sep-02 8:04
professionalChris Losinger9-Sep-02 8:04 
GeneralRe: Sending email Pin
Alwin7510-Sep-02 3:03
Alwin7510-Sep-02 3:03 
GeneralMCI refresh problem !!! Pin
Hadi Rezaee9-Sep-02 7:24
Hadi Rezaee9-Sep-02 7:24 
GeneralRe: MCI refresh problem !!! Pin
Joaquín M López Muñoz9-Sep-02 7:37
Joaquín M López Muñoz9-Sep-02 7:37 
GeneralRe: MCI refresh problem !!! Pin
Hadi Rezaee9-Sep-02 8:27
Hadi Rezaee9-Sep-02 8:27 
QuestionWhat to do????? 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..........

GeneralGUI/Data Design question Pin
JennyP9-Sep-02 6:58
JennyP9-Sep-02 6:58 
GeneralRe: GUI/Data Design question Pin
Joaquín M López Muñoz9-Sep-02 7:08
Joaquín M López Muñoz9-Sep-02 7:08 
GeneralRe: GUI/Data Design question Pin
JennyP9-Sep-02 8:14
JennyP9-Sep-02 8:14 
GeneralRe: GUI/Data Design question Pin
Joaquín M López Muñoz9-Sep-02 8:25
Joaquín M López Muñoz9-Sep-02 8:25 
QuestionDoes anyone have MFC Grid 2.23? Pin
petrym9-Sep-02 6:42
petrym9-Sep-02 6:42 
AnswerRe: Does anyone have MFC Grid 2.23? Pin
Joaquín M López Muñoz9-Sep-02 6:49
Joaquín M López Muñoz9-Sep-02 6:49 
GeneralRe: Does anyone have MFC Grid 2.23? Pin
petrym9-Sep-02 7:07
petrym9-Sep-02 7:07 
GeneralRe: Does anyone have MFC Grid 2.23? Pin
Joaquín M López Muñoz9-Sep-02 7:14
Joaquín M López Muñoz9-Sep-02 7:14 
GeneralRe: Does anyone have MFC Grid 2.23? Pin
petrym9-Sep-02 7:20
petrym9-Sep-02 7:20 
GeneralChanging dialog background color ... Pin
Hadi Rezaee9-Sep-02 6:41
Hadi Rezaee9-Sep-02 6:41 
GeneralRe: Changing dialog background color ... Pin
Joaquín M López Muñoz9-Sep-02 6:46
Joaquín M López Muñoz9-Sep-02 6:46 
GeneralRe: Changing dialog background color ... Pin
Hadi Rezaee9-Sep-02 6:53
Hadi Rezaee9-Sep-02 6:53 
GeneralRe: Changing dialog background color ... Pin
Joaquín M López Muñoz9-Sep-02 7:03
Joaquín M López Muñoz9-Sep-02 7:03 
QuestionGet refresh rate (frequency) of current display mode under Win9x? Pin
FatBastardDelivery9-Sep-02 5:46
FatBastardDelivery9-Sep-02 5:46 
GeneralAnimated GIF !!! Pin
Hadi Rezaee9-Sep-02 5:25
Hadi Rezaee9-Sep-02 5:25 
GeneralRe: Animated GIF !!! Pin
Chris Losinger9-Sep-02 5:47
professionalChris Losinger9-Sep-02 5:47 
GeneralCombo Box Control. Pin
arthivjii9-Sep-02 5:22
arthivjii9-Sep-02 5:22 

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.