manual Control Messages in MFC

I m sure someone done this before

my CFormView derived class has a few checkboxes.
I want to force the message handlers of all the checkboxes to be called when 
I change (check/uncheck) one of them. I dont want to use the group thing.
my code is like this
CMyFormView::OnCheck1()
{
m_bStatusCode = ((CButton *)(GetDlgItem( IDC_CHECK_COMPILE_CODE 
)))->GetCheck() ? TRUE : FALSE;

m_MyGUI = COMPILE_CODE;
/*     needs to send the notify the parent to execute the other message 
handlers*/
}
CMyFormView::OnCheck2()
{
m_bStatusAssets = ((CButton *)(GetDlgItem( IDC_CHECK_BUILD_ASSETS 
)))->GetCheck() ? TRUE : FALSE;
if(m_MyGUI == COMPLE_CODE)
{
     /* do something */
}

....
.....
.......

Is this possible?

Regards
Viper
0
BrownViper (25)
12/2/2004 4:07:09 PM
vc.mfc 33608 articles. 0 followers. Follow

2 Replies
745 Views

Similar Articles

[PageSpeed] 11

Why dont you change your message map to execute the same function for all
the Check box events. So that, whenever, any of the check box is clicked, it
will call the same function.

-- 
------------------------------
Ashok K Kumar
------------------------------
"BrownViper" <BrownViper@discussions.microsoft.com> wrote in message
news:FF026368-6DF0-44D5-ADA0-C9895A0340A4@microsoft.com...
> I m sure someone done this before
>
> my CFormView derived class has a few checkboxes.
> I want to force the message handlers of all the checkboxes to be called
when
> I change (check/uncheck) one of them. I dont want to use the group thing.
> my code is like this
> CMyFormView::OnCheck1()
> {
> m_bStatusCode = ((CButton *)(GetDlgItem( IDC_CHECK_COMPILE_CODE
> )))->GetCheck() ? TRUE : FALSE;
>
> m_MyGUI = COMPILE_CODE;
> /*     needs to send the notify the parent to execute the other message
> handlers*/
> }
> CMyFormView::OnCheck2()
> {
> m_bStatusAssets = ((CButton *)(GetDlgItem( IDC_CHECK_BUILD_ASSETS
> )))->GetCheck() ? TRUE : FALSE;
> if(m_MyGUI == COMPLE_CODE)
> {
>      /* do something */
> }
>
> ...
> ....
> ......
>
> Is this possible?
>
> Regards
> Viper


0
12/2/2004 5:37:08 PM
I am not really sure as to what you are trying to accomplish but take a look
at
ON_CONTROL_RANGE and see if that will help you.
It will let you assign a range of control to the same function, when the
function gets called it will pass the id of the control that triggered the
message. You might be able to put all of your functionality for all the
checkboxes in the same method.

Or you can simply call the OnButtonClicked function of the other checkboxes
from every other checkbox

Example
void CMyDialog::OnButton1Clicked()
{
    do what every
    OnButton2Clicked();
    OnButton3Clicked();
}

void CMyDialog::OnButton2Clicked()
{
    do what every
    OnButton1Clicked();
    OnButton3Clicked();
}

AliR.

"BrownViper" <BrownViper@discussions.microsoft.com> wrote in message
news:FF026368-6DF0-44D5-ADA0-C9895A0340A4@microsoft.com...
> I m sure someone done this before
>
> my CFormView derived class has a few checkboxes.
> I want to force the message handlers of all the checkboxes to be called
when
> I change (check/uncheck) one of them. I dont want to use the group thing.
> my code is like this
> CMyFormView::OnCheck1()
> {
> m_bStatusCode = ((CButton *)(GetDlgItem( IDC_CHECK_COMPILE_CODE
> )))->GetCheck() ? TRUE : FALSE;
>
> m_MyGUI = COMPILE_CODE;
> /*     needs to send the notify the parent to execute the other message
> handlers*/
> }
> CMyFormView::OnCheck2()
> {
> m_bStatusAssets = ((CButton *)(GetDlgItem( IDC_CHECK_BUILD_ASSETS
> )))->GetCheck() ? TRUE : FALSE;
> if(m_MyGUI == COMPLE_CODE)
> {
>      /* do something */
> }
>
> ...
> ....
> ......
>
> Is this possible?
>
> Regards
> Viper


0
AliR (179)
12/2/2004 7:38:25 PM
Reply:

Similar Artilces:

MFC and threads #3
Greetings, I am running into a problem when trying to pause a thread in MFC based application. This is my first time using user defined Events for synchronization. The scenario is like this. Code executes in a worker thread and based on some conditions thread launches another new dialog window. That window displays some message to user ie, Hello There! in an Edit control. I provide a Resume button on the bottom of that message Window so that user can continue after reading the message and the worker thread should continue from where it left off. This is the code for that Resume button. v...

Message for Stan
I have been reading that you are starting a new "Global Empire" and are looking for people to hire. I was wondering if you will be having an Internet in your new "Global Empire" and if so, is the job of "Moderator" available? I would like to apply for that job. Please let me know where I can get the application. Thanks very much. A loyal subject!!! ...

Control "Reply to all" for dl's.
We have a global distribution list that only one user will have access to. How do we stop someone from replying to all when they receive a message from that dl? thanks On Thu, 12 May 2005 12:36:06 -0700, "MJKQB" <MJKQB@discussions.microsoft.com> wrote: >We have a global distribution list that only one user will have access to. >How do we stop someone from replying to all when they receive a message from >that dl? > >thanks Exchange General tab/ Message Restrictions and add the users who can send to that DL. ...

Importing WLM Messages
I recently converted from Win 7 RC to Win 7 Pro, before I wiped my drive I exported all of my information. When I began the import process everything went smooth. Contacts, accounts, favs, cookies ect. all came over without a problem, however my messages will not import. I get an error that says: "No messages can be found in the folder or another application is running that has required files open....." I have nothing else open and when I manually go into the directory I can open the messages one at a time. However they are in no order and it very hard to fin...

When hitting reply to a message, no "Bcc:" header field appears
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel Email Client: Exchange Hi. When I hit &quot;Reply&quot; or &quot;Reply All&quot; to a message in Entourage, the composition window that appears has the usual &quot;To:&quot;, &quot;Cc:&quot;, and &quot;Subject:&quot; form fields near the top, but not one for &quot;Bcc:&quot;. I've looked all over Preferences but don't see an option for this. What am I missing? <br><br>Thanks, <br><br>-c On 2/26/10 11:51 AM, cmetzler@officeforma...

Email Message(s) Not Being Retrieved
I've been waiting for an email today but Windows Mail hasn't retrieved it. I then decided to go online to my email client's web site and the email is there! The email was posted on the server today at 10:05 AM. The message isn't in any of my other Windows Mail folders including the Junk Email folder. Any idea why this message isn't being retrieved by Windows Mail?? James Sorry I found the message. I had them sorted oldest to newest. Duh. "JamesJ" <jjy@darwin_roadrunner.com> wrote in message news:%23r5VO4H7KHA.420@TK2MSFTNGP02.phx.gbl....

Exchange OMA error message. Please read...
When our i-700's with Pocket PC 2003 attempts to access our mail exchange server, all we receive is the following error message: " A System error has occurred while processing your request. Please try again. If the problem persists, contact your administrator. Home" mail.domain.com/exchange works fine though. We've installed the service pack 1 for exchange 2003 to attempt to fix this issue and are having the same results. Does anyone care to share how they may have overcome this exchange problem with their compatible PDAs and Exchange's OMA (Outlook Mobile Access...

Third request for help with Payables Error message!
Ok I have posted this for the third time with no response! I need help to know if there is any kind of issue on the back end of our environment. If someone could help it would be greatly appreciated! We are currently running GP 10 SP1 and apparently since version 8 (we did not upgrade to 9) there has been the following error message while launching a transaction out of Smartlist, when we go to inquiry for AP documents, and drill down of PMTRX & PMCHK from the JE inquiry view: Unhandeled Script Exception: Index 0 array of 'PM_Transaction_Inquiry_Fill' Script terminated We ran a ...

Outlook/Access 2003
I've been doing a lot of research and purchased (but haven't completely read) Sue Mosher's book. However, before I spend much more time I'd like to find out if my idea is even feasible. The basic idea is to create an appointment system for multiple therapists that can be used by a receptionist and other staff. Using Outlook and Exchange is very nice but the appointment data needs to end up in an Access table immediately. We can purchase SBS 2003 with Exchange 2003 or we can buy a third party tool for calendar sharing whichever would be the easiest to use. I currently...

message stuck in outbox
large attachment in outbox locking up application. regular delete will not work; how do i delete Are you connecting to an Exchange server or are you using a pst. "hodges" <kc_hodges@hotmail.com> wrote in message news:06b101c366bd$0b84cad0$a401280a@phx.gbl... > large attachment in outbox locking up application. > regular delete will not work; how do i delete ..pst >-----Original Message----- >Are you connecting to an Exchange server or are you using a pst. >"hodges" <kc_hodges@hotmail.com> wrote in message >news:06b101c366bd$0b84cad0$a40...

Excel 2007 compatibility checker message
I have a spreadsheet created in Excel 2003. I open it in Excel 2007 and Save As without making any changes. I get a compatibility error: "Some formulas in this workbook are linked to other workbooks that are closed." It does not have a "find" link. How do I find these formulas? Thanks. JerryK You could use Edit Links on the Data tab to see what the names of the linked workbooks are and then do a Find on them. If that doesn't work you might try Bill Manville's Find Link utility although I don't know how it works with Excel 2007: http://www.oaltd.co.u...

Saving html message as Draft changes text formatting...
WIN XP HE, OL 2002 Hi, I have recently noticed that whenever I write an email (using Word as editor) in html format, and instead of sending it, save it (to the drafts folder), the text itself changes format from my default to another one. It seems to change in the paragraph style which then changes the text format. The only change I recently made was to edit my signatures in html, rtf and plain text format. When I write a new email, it opens up with the signature already in it and perhaps there are format/style conflicts..? Tx for shedding some light into this. S As an added information, t...

active X control
I have a calandar (active x control) on my form. Does anyone know how to link/sync it to a bound control; i.e., when a user chooses a date control, the calandar appears, and when a date is selected it populates into the requisite field. alex Try this: http://www.datastrat.com/Download/XCalendar2K.zip -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.mvps.org/access http://www.accessmvp.com "alex" <sql_aid@yahoo.com> wrote in message news:1182963470.109302.283780@q75g2000hsh.googlegroups.com... >I have a calandar (active x control) on my form. > Does anyo...

increment through controls on form
I have a form that I've name the controls on it in such a way that I could determine through open args if it should be locked or not. Example any text box that begins with txtd would be unlocked with open args of 1. I was hoping there was a way I could just move through the controls in a loop and set that property with one function.....I'm not for sure how to accomplish this though. Does anyone have some sample code on how to "loop" through all the controls on a form and set the locked property? I can write the criteria portion if I could get a sample of how to ...

Recipient appears twice in the message header
Hi, I have a user with Outlook 2000 set up as IMAP. She received a few e-mails yesterday where she appears in the recepient(TO) field 2 or 3 times, but the sender has only put her address once. I have checked the header in the raw MSG file and her address only appears once. What could cause this? How do I fix this? Please advise. The user is driving me nuts with this. Thanks, Ed ...

Possible to create a rule to alert on BCC messages?
Using Outlook 2007/Exchange Server 2007 Hello: I sometimes miss that I'm receiving an email as a blind copy. I was hoping to create a rule to alert me when I'm in the BCC field. However, when using the rules wizard, I only see the options regarding my name in the To or CC field. Is there a way to create this that I may be missing? Thank you. In article <#pJLIK1ALHA.4704@TK2MSFTNGP06.phx.gbl>, victoria@dig.com says... > > Using Outlook 2007/Exchange Server 2007 > > Hello: > > I sometimes miss that I'm receiving an email as ...

Choose Profile Message When Sending Report to Mail
We are having a problem with Mail Configuration. We are using GP published through Citrix. We log into the desktop as a particular user, and configure the default Mail Profile using Mail in the Control Panel, which is Outlook. The problem is that whenever we Print a report to Screen, then go Send Mail as text, it pops up with the Choose Mail dialog. After clicking on Options (on the Dialog) you can check "Default Profile" and it sends the email. Yet when we close GP and re-open it, the Choose Profile dialog appears again. Any ideas why this is happening? Regards Konrad Konr...

MFC get drive information
Dear all, How to get drive information of my computer? I want to get available driver letters and the corresponding disk space information. Thanks! Best Regards, Crystal Use GetLogicalDrives() to get drive informatio. Use GetDiskFreeSpace(... to get drive space. Sekhar Hyderabad. "Crystal" wrote: > Dear all, > > How to get drive information of my computer? > > I want to get available driver letters and the corresponding disk space > information. > > Thanks! > > Best Regards, > Crystal > > > > > You can use cha...

Unable to delete the Dead Domain controller
Dear, Iam working on windows server 2008 Ent Ed I have two doman controllers in the domain both are GC but only one domain controller has all the fsmo roles but iam having replicattion problems with the dead DC (i.e mppkw-database) and Iam unable to delete or remove the dead domain controller from the domain and iam having follwing problems using the ntdsutil :- matadata cleanup select operation target: list domains Found 1 domain(s) 0 - DC=mediaphoneplus,DC=com select operation target: select domain 0 No current site Domain - DC=mediaphoneplus,DC=com No current server N...

Exchange error
Hello, for one week now, my exchange 2000 server crashes nearly every night at random time, the only solution to have it all restart is to restart the entire server. In the application log, multiple error events are reported like these : Event Type: Error Event Source: Userenv Event Category: None Event ID: 1000 Date: 26/07/2005 Time: 01:27:39 User: NT AUTHORITY\SYSTEM Computer: BELLINI Description: Windows cannot establish a connection to *domain name* with (1364). Event Type: Error Event Source: Userenv Event Category: None Event ID: 1000 Date: 26/07/2005 Time: 01:37:41 User: ...

More control over taxation
I would like to be able to exempt items for different levels of taxation while still using "tax by customer." Rather than taxable or non-taxable, I need to be able to exempt from federal and state separately. Thanks, dan@endurosport.com ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree...

question about leaving messages on server
My husband and I have 1 POP mail account. I am accessing it from a computer in Virginia, where I'm staying with relatives. He is accessing the same account from California. I have my Outlook set up to keep messages on the server, but to delete them after 1 day (so that he will still get the messages, but the server won't get clogged). His email program, Eudora, is set up so the messages will be deleted from the server after he downloads them. Is there a chance I won't get some messages because he has his computer set up that way? (He downloads it 1st, then it gets deleted off serv...

How do I get outgoing messages to send from a particular email ac.
I have multiple email accounts set up in Microsoft Office. Whenever I compose new mail, it is outgoing from one of them, but as I rarely use that internet service anymore, I want it to come from another one. How do I change what email address is displayed on my outgoing messages? State your Outlook version and, if 98 or 2000, the mode (help->about->second line should say.) --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. Due to the (insert latest virus name here) virus, all mail sent to my personal account will be deleted without read...

message does not display on in-coming mail
in outlook express, for in-coming mail, i see the sender, attachments and subject but the space for the message is blank. any suggestions Try posting this in an Outlook Express news group - this is not one of them. Outlook is a part of Microsoft Office and is what this group supports. Outlook Express is a part of Internet Explorer and has its own news groups. You can also find some good Outlook Express information here: http://insideoe.tomsterdam.com --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. Due to the (insert latest virus name here...

Tab control + having same size for all tabs
Hello All I am working on tab control in which I want to set the same size of all tabs of tab control. I am adding the tabs dynamically . When I saw the .NET style tab control ( Look tab control used in MSDN) , I felt that it is more elegant than the old looked MFC tab control. My ultimate goal is to have the same size for all tabs irrespective of text it has ( MFC's default behaviour shows the full text in tab ) If the text exceeds that width, then It will make it shortened by adding .... ( three dots ) (e.g. "The text of tab...Will Come here" ) , I know that I will have to wri...