Communicating between two menu item using OLE?? 
Author Message
 Communicating between two menu item using OLE??

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
*
********************************************************



Sun, 30 Sep 2001 03:00:00 GMT  
 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
> *
> ********************************************************



Wed, 10 Oct 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Communicating between two menu item using OLE??

2. Communicating between two menu item using OLE?

3. using SWITCH 4 menu items

4. Calling Functions used by Menu Items

5. using dot instead of check mark on menu item

6. Renaming a file item using default context menu.

7. how will two components communicate

8. Communicate between two ActiveX Control in both direction

9. Communicating between two ATL COM objects

10. How to communicate between two applications?

11. :-) How Can Two COM Object Communicate

12. Utilizing ODBC to communicate two different processes on different machines

 

 
Powered by phpBB® Forum Software