Posting a Message to another class

Hi

I've an application that has a class having a Callback function that
recieves event messages. I want to process some of these events in another
class. How can i Post these messages to be processed in other class. I tried
using the postmessage but that asks for a window handle but the class that I
want to process those messages in is a simple generic class without any
window associated with it. Is there any way I can do so in this generic
class.

Regards

Atif


0
atif1 (3)
8/2/2005 5:14:45 PM
vc.mfc 33608 articles. 0 followers. Follow

4 Replies
816 Views

Similar Articles

[PageSpeed] 36

If you have to Post a message (because of thread) then what most people do
is inherit the class from a CWnd, and create the window as a hidden window.
That way it can receive messages from the message queue.
It is actually difficult to give you sound advice, unless you tell us how
the program is written. (Why some event's are being processed in a different
class, whether there are threads involved, why you wouldn't pass a pointer
of the reciving class to the sending class, who creates instances of each of
these classes?)

AliR.

"Atif" <atif@advcomm.net> wrote in message
news:ODvbqV4lFHA.3144@TK2MSFTNGP12.phx.gbl...
> Hi
>
> I've an application that has a class having a Callback function that
> recieves event messages. I want to process some of these events in another
> class. How can i Post these messages to be processed in other class. I
tried
> using the postmessage but that asks for a window handle but the class that
I
> want to process those messages in is a simple generic class without any
> window associated with it. Is there any way I can do so in this generic
> class.
>
> Regards
>
> Atif
>
>
>


0
AliR3470 (3235)
8/2/2005 7:11:46 PM
Is AliR's assumption that you are working with multiple threads correct?  If you are not 
multi-threading, then perhaps posting a message is not your best solution.  You may simply want to 
create your own "message queue" designed specifically for communication between these two classes.

With more info from you, we can give more ideas.

"Atif" <atif@advcomm.net> wrote in message news:ODvbqV4lFHA.3144@TK2MSFTNGP12.phx.gbl...
> Hi
>
> I've an application that has a class having a Callback function that
> recieves event messages. I want to process some of these events in another
> class. How can i Post these messages to be processed in other class. I tried
> using the postmessage but that asks for a window handle but the class that I
> want to process those messages in is a simple generic class without any
> window associated with it. Is there any way I can do so in this generic
> class.
>
> Regards
>
> Atif
>
> 


0
ScotB (233)
8/2/2005 7:30:54 PM
A generic class has no concept of posting/sending a message. If you are
talking about handling WM_COMMAND types of messages, you can derived
your class from CCmdTarget (CWnd is derived from it too). You will
still need to route it to your class (using OnCmdTarget).

If you want to handle any other messages, either derive from CWnd or
simply use callbacks in your class.

----------
Ajay Kalra
ajaykalra@yahoo.com

0
ajaykalra (6842)
8/2/2005 7:35:59 PM
hi,
    i want to connect to oracle using mfc CDatabase so that i can query
database .. plz help me ,  what steps i needed to do this..
thanx in advance
Atif
"Atif" <atif@advcomm.net> wrote in message
news:ODvbqV4lFHA.3144@TK2MSFTNGP12.phx.gbl...
> Hi
>
> I've an application that has a class having a Callback function that
> recieves event messages. I want to process some of these events in another
> class. How can i Post these messages to be processed in other class. I
tried
> using the postmessage but that asks for a window handle but the class that
I
> want to process those messages in is a simple generic class without any
> window associated with it. Is there any way I can do so in this generic
> class.
>
> Regards
>
> Atif
>
>


0
atif1 (3)
8/5/2005 7:52:24 AM
Reply:

Similar Artilces:

counting email messages being sent out
I am new to exchange 2003 administration. Is there a tool within MS Exchange 2003 that can bring up a count of how many emails were sent out for a particular time frame? Or is there a utility to download that can be used? Performance Monitor has lots of exchange counters. Try there. Vince -- Vince "Rob" wrote: > I am new to exchange 2003 administration. Is there a tool within MS Exchange > 2003 that can bring up a count of how many emails were sent out for a > particular time frame? Or is there a utility to download that can be used? Vince, Thanks for the heads up...

item stock inquiry error message
when I try to do an item stock inquiry, the following message pops up "An open operation on table 'tcsSYSTB00000_WindowsParams' failed accessing SQL data." when I clink to show more info, this is shown "[Microsoft][SQL Native Client][SQL Server]CREATE TABLE permission denied in database 'DAI'." Any idea how to fix this issue? Thanks - That sounds like a Trinity Computer Services table - have you asked them about this? -- Victoria Yudin Dynamics GP MVP Want to use Crystal Reports with GP? http://www.flex-solutions.com/gpreports.html blog: http://ww...

Posting old bills
I am setting up Money 2006 to tract income and expenses for a rental property, but I need to back date it to 1/1/2007. How do I enter bills and deposits made in the past? Thanks Go to the account register and enter the manually. Just click on the next blank transaction and go to town. You may want to make sure you are using Advanced Register. If there are subsequent transactions already in these accounts and you have balanced the accounts to statements--as though these transactions were already entered--then you will have to adjust account beginning balances and/or Account Adjustment...

* OWA... (Third Post)
Microsoft? If you're concerned about security then you should respond to this question. We cannot make this OWA server available on the Internet without applying the latest SP and critical updates. =========================== Our OWA Exchange 5.5 server (Windows NT Server) recently died and we replaced it with a Windows 2000 Server. We installed Exchange 5.5 OWA then applied Exchange SP4. Everything was working until we apply Windows 2000 SP4. Everytime we logon we get "OWA was unable to get to your inbox" error. As soon as we un-installed Windows 2000 SP4, OWA wo...

Filtering out values that don't exist on another worksheet
I'm trying to take a worksheet and filter out values that don't exist on another worksheet Chip Pearson has a bunch of techniques for working with duplicates at: http://www.cpearson.com/excel/duplicat.htm Smokeyhavoc wrote: > > I'm trying to take a worksheet and filter out values that don't exist on > another worksheet -- Dave Peterson Perhaps you may like to try this as well .. Assume you have a list in Sheet1, A1:A10 -------------------------- 100 101 102 103 104 105 106 107 108 109 and another list in Sheet2, A1:A5 ------------------------ 102 103 105 107...

To the sender of the MI5 posts
I am not sure if you read responses or (like most other spammers) just see the web as a place where you are free to say whatever you want without fear of contradiction. Who knows? Either way - this section of this site is site is specifically here so that anyone with a comment, question, point to rise, etc regarding access databases can post with the knowledge that other likeminded people may read their post. It is not here as a general forum to discuss other matters. I have no doubt that if you are blocked from posting you will see this as yet another indication that MI5 is after yo...

Can I sort text data by reference to text data in another column?
I have imported text data (e-mail addresses) into a worksheet that also has a column of text data (also e-mail addresses), many of which, but not all, are the same as the imported text data. I wish to sort the imported text data into the rows of the matching original text data. How do I do that? The basic process would be to get all email addresses into a single column. Then select ALL columns to be sorted and use Data --> Sort and choose the column with the email addresses as the column to base the sort on. Duplicate email addresses will end up on adjacent rows. &q...

OL07 keyboard "short"cuts in the Message Window?
In OL03, I was able to change the account to send a message with Alt+N followed by the number. Now, it seems, the shortcut is Alt+H,Y,1 followed by the number. Similarly, to send a message, I would use Alt+S. Now I have the choice of Alt+H,S or Alt+F,E. (Or Ctl-ENTER, I suppose.) Is there anything I can do to make OL07 use shorter shortcuts? Alt+S should still work... -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Coauthor, OneNote 2003 for Windows (Visual QuickStart Guide) Need Help with Common Tasks? http://www.outlook-tips.net/beginner/ Outlook ...

Outlook Message Inline Text
I have Outlook 2002 and need to know if I can change my received message format to inline text. Right now I have e-mails that have been forwarded multiple times as attachments instead of inline text but I can't synchronize it with my Pocket PC because of this. Any Suggestions? Thanks, Benny ...

What's the difference between Cross-posting and Multi-posting
And thanks for the discussion earlier... although the rudeness was unneeded. Sign me, A New User (and learning from you all) rochgal, you wrote on Thu, 22 Sep 2005 14:53:03 -0700: > What's the difference between Cross-posting and Multi-posting Cross-posting = You send one posting to several newsgroups. Multi-posting = You send several postings (with the same content) to several newsgroups. -- Best Regards Christian Goeller Some misspellings, grammatical or linguistical mistakes found? All corrections would be appreciated! ...

Post to GL
Hello I am having a problem with a setting within Great Plains 8.0 service pack 2. I have posting setup to only allow posting from the batch level for Inventory. But when you go into Inventory Batches the check box for post to gl is not marked. If I have it setup in posting to post to the gl shouldn't this check box be marked in inventory batches? -- Thanks, Brian Apples and oranges. The post to GL checkbox on the inventory batch window tells the system whether an IV transaction will post at all. The posting settings in tools --> setup --> posting tell the system w...

Intrastat posting issue
We are a UK company using intrastat. At the moment we cannot post invoices directly (thru) to the General ledger because we are getting an error saying that the 'intratsat information is missing'. When we click on an invoice that won't post in the Sales Transaction Entry screen, and click on the blue EC flag box, all the intrastat data is there and correct. Then when we post it goes through to the GL correctly. It seems that it will only post to the GL if every single line is checked (via the Blue EC flag) on the sales invoice regardless of the fact that all the date is alr...

Access 2002 bug: "dynamic" forms problem
There was no respond to my original post in microsoft.public.access.forms (May 5th 2007) about a fortnight so I try it here... ��������������������������������� A while ago we had a discussion about A2002 (sub)form which changes dynamically from code (hide/unhide controls, change subfom's width, etc.). There's a problem if I make some changes in code when the form is open: if I save changes, A2002 saves controls positions & subform's size as well. This is a BIG A2002 BUG and it's really annoying. Why Access forms don't behave as Visual Basic forms? I don't want Acc...

where is my post??
twice now I have typed up my post & sent it. So where is it? On Wed, 18 Jul 2007 08:41:36 -0700, Stapes <steve.staple@gmail.com> wrote: >twice now I have typed up my post & sent it. So where is it? On Google Groups: 1184773041.958329.270430@e16g2000pri.googlegroups.com Google's been having some problems lately, maybe it's temporarily unavailable. John W. Vinson [MVP] You mean the multiple posts with subject "Cancel = true"? I see 3 of them, and Allen Browne's already provided an answer. -- Doug Steele, Microsoft Access MVP http://I...

Is there a way I can only print the reply instead of the entire email message
I wonder if there is a way I can only print the reply to an email message, instead of printing the entire message? My choice for selection only seem to be gone with Outlook 2003 printing options. Any help is appreciated.............Peter ...

How to copy classes to another project for class wizard to work properly
hi, I have some classes derived from generic CWnd. They work ok. But when I copy them to another project, the class wizard does not see them. How can I add these classes to class wizard? thanks, Behzad behzadvc wrote: > hi, > I have some classes derived from generic CWnd. They work ok. But when I copy > them to another project, the class wizard does not see them. How can I add > these classes to class wizard? > > thanks, > Behzad > > Delete the project's .clw file then open the project in VC and open the class wizard dialog. It will scan all files a...

Duplicate messages when filtering
I have created a rule to MOVE messages from one address to a subfolder, but every time these messages arrive, Outlook puts a copy of the message on the Inbox AND ALSO on the subfolder I specified on the rule. I checked the rule and the action ONLY says to MOVE the e-mail to the specified subfolder, not to leave a copy on the mais Inbox folder. I'm very annoyed by this, because I always have to go to the Inbox and delete the message copy. Any ideas? ...

My post not posted!
A couple of times when I've posted a reply to a recent post (same day), and later tried to view it, I found the header with a line drawn through it, and the following in the message body view pane: Message is no longer available on the server Windows Live Mail is unable to retrieve the requested message because the server no longer has the message available. -------------------------------------------------------------------------------- News servers regularly expire articles as they get older to make space available for newer articles. IMAP servers can be accessed by multip...

Sending message 1 of ....
In general, sending is fine but I get a "Sending message 1 of X" message in the status bar which does not correspond to anything. It started with "Sending Message 1 out of 2" a few months ago. It has recently grew up to 11. The only message I get is "503 bad sequence of command". All my fellow workers, connecting to the same server with the same Outlook 2003 version do not have this issue Any idea ? ...

Can't view Messages
I cannot view any newsgroup messages in the preview pane. The only way i can view it is to "reply" then i see the message below my reply. I have Win XP Pro, and Outlook 2003. Any help is appreciated. (My outlook / email works fine). -Matt nutshell222@hotmail.com Hi Matt, please use Outlook Express as Newsreader -- Ich habe nichts gemacht, gestern gings noch! Bitte in den Newsgroup antworten damit jeder etwas davon hat. Bravestar@Datenschutzministerium.de "Matt" <nutshell222@hotmail.com> schrieb im Newsbeitrag news:ZqadneKI2qQ5RZvcRVn-uw@warpdrive.net... > ...

Cannot send newsgroup post with an attachment
I can send and receive posts using Outlook Express 6 newsgroups. I do not use html. When I send a post that has an attachment, e.g. a 160kB jpg that post never shows up as having been sent. How can I fix this? regards, "nobody" I can't speak for others, but msnews has a 100KB limit. If I have a need to post a graphic, I upload it to TinyPic and post the link to it. TinyPic: http://tinypic.com/ -- Bruce Hagen MS-MVP [Mail] Imperial Beach, CA "news.microsoft.com" <nobody@nowhere.com> wrote in message ...

Fixed Assets Error Message
I've just installed GP10 SP 1 945412 on a test server. Originally I only installed SmartList builder. I've just finished adding Fixed Assets, Analytical Accounting (and Grant Management) and Project Accounting. When I launch GP Utilities I get the following error message: Fixed Assets Product 309 does not support upgrading from version 6.0.0 or prior Does anyone know what this means? Thanks! Maatthias, If you run the following query against your DYNAMICS database, what is the result? select db_name, db_verMajor, db_verMinor, db_verBuild from DB_Upgrade wher PRODID = 309 B...

Message Recall #2
Hello, I'm using Outlook 2002 with an Exchange 5.5 server. When I attempt to recall a message sent to a local mailbox or to an external recipient, it fails with the "Your message could not be recalled" error message whether or not the message has been read and the message has not been deleted. Any resolution would be appreciated. Thank you. It's not very reliable to begin with and it should always fail to the external recipient. Does everyone internally use the same version of outlook? Does it work if they open the recall message? -- Diane Poremsky [MVP - Outloo...

New rules error message
I suddenly started receiving a "Rules in error" message "cannot remove messages from the folder". Rules seem OK. Any ideas ...

can't print outlook 2000 message
I have outlook 2000 When I print a message I get the error: an error has occurred in your program. To keep working anyway click ignore an save your work in a new file... and then the outlook is closed. what can I do print a message from outlook? I've seen this problem when printing an HTML message and trying to print to a different printer than the default printer. As long as I print to the default it works. Plain Text and RTF emails, I can print to any printer. Other option, Uninstall printer and reinstall it. "amc2" <amc2@013.net.il> wrote in message news:8b4b01...