Thanks Iain. It just bugged me, I kept thinking there got to be some “index” somewhere to keep track of the range. So – I made three major mistakes - I have no clue why I thought PostMessage(ID_whatever) would work. Second mistake and third – I thought the the MFC will route the message thru main frame first. So if I do PostMessage(WM_COMMAND, ID_STATUS_99) it works only when posted in main frame. I'll admit – most of the time I just do not understand how MFC routes the messages! In this “case” I have a Cview in splitter and maybe that is the “problem”. I guess I need to look it up somewhere , again!
I was planning to have the actual text in the function which updates the status text. Anyway – I'll take a look at registered message as you suggested. Cheers Vaclav
In the mean time I cheated this way AfxGetMainWnd()->PostMessage(WM_COMMAND ,ID_STATUS_99); but there is still a problem - the status update is called when anything is updated ( duh) and the text goes back to the first index in range. Working on that. Perhaps static text variable will do.
I would recommend against using WM_COMMAND for your status update message, and go for the registered window message:
1/ It saves command collision
2/ MFC does a LOT of work routing command messages about. This is one of its great strengths, and makes many things nice and elegant, but it can be confusing too.
3/ As long as you use the same string id for the message, you don't have to share header files, making code independence a bit cleaner.
Doing AfxGetMainWnd()->PostMessage is not cheating at all! Just change from WM_COMMAND and I'll be happy with you.
As you why the status bit is being reset? No idea, that will depend on the details of your code. I bet your command handler is being called from places you didn't expect. (See point 1 above).
I am one of "those foreigners coming over here and stealing our jobs". Yay me!
I wrote one application. The main frame is a form without border. So it donot have the task bar mouse click function. The first mouse click on the application icon in the task bar, the application will hide. The second mouse click, this application will show.
After I debug in the OnActiveApp, I find that sometime one OnActiveApp called, the other two OnActiveApp called when use mouse click the taskbar icon. How to filter the useless OnActiveApp event?
What is it that you're trying to do?
If you want the alter the minimize and restore operations that happen when you click on the task bar button, handle the WM_SYSCOMMAND message and check for SC_MINIMIZE and SC_RESTORE in its wParam argument.
You then simply return 0 to prevent the default action from being performed.
«_Superman_» I love work. It gives me something to do between weekends.
Pardon me!! I am new here. I am unable to use addNode function. When i declare Node* it doesnt compile.
I am trying to implement a linked list in c++ without
using structures and only use pure classes.I am rusty here. Any help would be great.
head->addNode() and head.addNode() doesnt work.
Create the object in the heap first. You just declared a variable stating "I will hold address of Node object in a variable head". But, where does that object? When there is no object head-> will not work. Head.addNode() also wont work as the object is not in stack.
Node* head = new Node();
I try to change CScrollBar's interface (MySkinScrollbar is delivered MFC's CScrollBar).
I loaded image to draw over the windows's classic interface -> It's done.
But when I click on "UpArrow" button in ScrollBar. The windows's classic interface is drawn over my image.
I think I should catch WM_LBUTTONDOWN and WM_LBUTTONUP message to redraw (calling Invalidate()).
I'm success in catching WM_LBUTTONDOWN message.
But I can't catch WM_LBUTTONUP message.
Please help me to solve this problem!
You can search with key word "//Why don't show message ?????". Jump to my problem.
This is my project (use VS 2003): Download Project
By the way, please tell me the way to reset default the Visual Studio 2003 (like has just installed)!
Thanks for all !!!!!
(I'm Vietnamese. So my English is not good. If I make some mistakes, please help me out.)
why do you need this handler ? Maybe you can slove your task in another way ...
First, I thank you for replying !
I need WM_LBUTTONUP to solve my problem: When I click on "Up/Left Arrow Button" or "Down Arrow Button", my scroll bar's interface become a window classic interface.
I have a mini clip to explain my problem.
405 means "Method Not Allowed". You get such a response for example when you send a http request with "POST" method but "POST" is not allowed. I used "POST" just as an example, it could be any of the other methods, even a custom one. The data you pasted to your message is a mime encoded stuff.
If you use pure HTTP and not HTTPS then install WireShark on your machine and capture the full http conversation and post it up here to get more accurate answers. (Use the output of the "Follow TCP Stream" feature of wireshark: you can reach "Follow TCP Stream" when you right click on a TCP capture entry in the list.)
Hi ,In program somethings of MFC wrote In registry,like Toolbar ,menu,and so on,I want to clean Mfc Toolbar info from the registry,in order to switch version and load different toolbar in different version,How to do it,I use SetRegistryKey(TEXT("Myprogram")),HOw to do it,how to clean the toolbar.
Yes,I wrote it in HKEY_CURRENT_USER\Software\Test\workspace,In workspace,there so many infos,like MFCToolBarParameters,MFCToolBar-593980,MFCToolBar-59392 ,MFCToolBar-169 and so on,I don't know delete what
to only delete toolbar.
The free edition of Visual Studio does have a resource editor.
It however does not support MFC or ATL.
So if you're trying to edit an MFC based on ATL based project, the resource editor would fail to load.
It refuses to access .rc (resource source-form) files, and thus I must edit my .rc files separately with a text-editor.
You get what you pay for, and in this case since it's free you don't get a resource editor. I find that I can manage quite well without one, although creating dialogs can be a little slow. If you want all the features of Visual Studio, including MFC, ATL etc then you need to buy one of the professional editions.