
Communicating between two menu item using OLE??
Leesze,
It appears to me that you are doing the right thing. I am assuming that the
"update function" you mention is an MFC ON_UPDATE_COMMAND_UI handler which
checks some program state (such as the state of your variable) and enables
or disables the menu item appropriately.
I think you are using the term OLE in its older and broader sense to refer
to a general method of client/server programming. This technique is used to
communicate between separate code modules (such as an application client and
a DLL server or an application client and another, local or remote,
application server). It is seldom used to communicate between elements with
the same application module.The more modern term for this is ActiveX or
COM-based programming.
There is another, more specific, meaning for the term OLE which refers to
embedding data from a server into a client application. The common example
of this is the embedding of Excel spreadsheet data into a Word document.
Again, this is not what you are doing between menu elements.
--
David E. Smith
MCSE, MCT, MVP
Quote:
> hi all,
> I have two menu popup item belonging to two different menu name
> in the main frame. Say when clicked on Menu A: popup item shows Item A
> and when clicked on Menu B: popup item shows Item B.
> I need to disable Item B when Item A is clicked on. What I have done is
> to make use of public static member vatiable: 'clicked', declared in the
> class that Item A belongs to and toggled it bew{*filter*} true and false. Then
> in the update function of Item B checked the status 'clicked' to
> determine the enable state of Item B.
> It works, but I do not think that this is the properway to do it. Do I
> make use of something call OLE (= Object Linking and Embedding)?? How
> does OLE work and where is it usually used? I am rather new to Window
> programming so I do not quite understand what OLE is for. Btw, I am
> using VC++ 6.0
> Thanks in advance. Please e-mail me in addition to the Newsgroup.
> leesze.....
> ********************************************************
> *As Imagination Bodies Forth
> *The Forms Of Things Unknown, The Poet's Pen
> *Turns Them To Shapes, And Gives To Airy Nothing
> *A Local Habitation And A Name
> *
> ********************************************************