|
Hi,
TAB Messages from child dialog is not going to child dialogs message queue,but it is to the parent windows!! So whenever TAB is pressed parent window gets the focus. How to get the control to the child dialog itself!
With Best Regards,
A.Ilamparithi
|
|
|
|
|
In MFC or Win32? If Win32 are the dialogs modeless or modal? If modeless, are you calling IsDialogMessage in your message loop?
|
|
|
|
|
Hi,
If I have two doc/views and I have some data in the second viewor document.
How do I get the data from the second view document if I am currently in the first view/document.
I must be doing the dynamic_cast wrong as it is non null but I can't access any local data from the class. Has any one got a small code fragment that explains how to get to another doc/view when inside a doc/view using the CDocTemplate stuff?
I used GetDocTemplate etc but now I would to get to the current view.
Thanks,
flip
|
|
|
|
|
Not sure if this is what you need to do.
In your document object use GetDocTemplate() . You can then iterate all the open documents of that type using GetFirstDocPosition() and GetNextDoc() . You can compare the returned pointer to this to see if you are looking at yourself. Once you have the pointer(s) to the other doc(s), you can iterate them for their view(s) using GetFirstViewPosition() and GetNextView()
If you are starting in the view, you need to use GetDocument() first of all.
Roger Allen - Sonork 100.10016
Roger Wright: Remember to buckle up, please, and encourage your friends to do the same. It's not just about saving your life, but saving the quality of life for those you may leave behind...
|
|
|
|
|
Hello guys,
I am having this problem to access (more specifically, to change text) the statusbar directly or indirectly in a MFC worker thread of my dialogue-based application.
The status bar was firstly created in my main dialogue class' OnInitDialog().
m_statusbar.Create(this);
m_statusbar.SetIndicators(indicators, 2);
m_statusbar.GetStatusBarCtrl().SetBkColor(RGB(180,180,180));
m_statusbar.SetPaneText(0, "Offline");
SetTimer(100, 1000, NULL);
The m_statusbar is a CStatusBar type member in the class declaration.
CStatusBar m_statusbar;
As I need to change the text in some functions in other classes and threads, I tried to make the statusbar accessible globally by having
pStatusBar = &m_statusbar;
also in the OnInitDialog, where CStatusBar *pStatusBar is declared as a global variable.
While there was no problem with compilation, but I'd encounter assertion error if I try to use pStatusBar to change text of the statusbar in the thread function, whether directly or indirectly (uses the change statusbar text function in other class), examples below:
UINT doPrintingProc(LPVOID param)
{
COtherDlg *ptr = (COtherDlg *)param;
pStatusBar->SetPaneText(0, "Testing");
ptr->ChangeStatusText("Testing");
}
I use the similiar way to manipulate the globally accessible CListView and CEdit text box, all seem to have no problem.
Would appreciate if someone could point out where I have done wrong.
|
|
|
|
|
I suspect your CStatusBar is doing a sanaty check and your blowing up in a ASSERT_VALID(this) call somewhere in CStatusBar. One of the things MFC classes often do is check for themselvs in handle maps when you call various mathods on them - the long and short of it is not all MFC classes can be passed around between threads in this way, and there is nothing you can do about it directly.
what you have to do is to use messages to communicate between the threads.
Declare a custom message:
#define WM_CHANGESBTEXT WM_USER+0x400
Add a hander for it to your dialog:
class CMyDialog:
{
LRESULT OnChangeSBText(WPARAM, LPARAM);
.
.
.
};
Wire up the message map:
BEGIN_MESSAGE_MAP(CMyDialog...)
ON_MESSAGE(WM_CHANGESBTEXT, OnChangeSBText)
...
Then implment the method:
LRESULT CMyDialog::OnChangeSBText(WPARAM wp, LPARAM)
{
LPCTSTR pszText = (LPCTSTR)wp;
m_statusbar.SetPaneText(0, pszText );
ChangeStatusText(pszText);
return 0;
}
Then in the thread, rather than do it directly, just send a message to the main dialog
UINT doPrintingProc(LPVOID param)
{
LPCTSTR pszString = "Testing";
AfxGetMainWnd()->SendMessage(WM_CHANGESBTEXT, pszString);
}
Dont forget to use Send (not post) message if your string can go out of scope.
}
|
|
|
|
|
Thanks alot, Diddy,
it works out nicely except a small fix for me to get it compiled -
AfxGetMainWnd()->SendMessage(WM_CHANGESBTEXT, (WPARAM)pszString)
As you have pointed out, not all of MFC classes can be passed around among the threads. But for those they do work out no trouble (direct pointer passing), is it safe to do it that way and not changing to SendMessage? This brings my another question. From what I'm thinking of SendMessage() now, it allows one thread (or class etc..) to basically send command the other class to perform its specific function(s), with options to also pass some desired data along. In my case, the changing of statusbar's text is done by its belonging class (my main class) with the original statusbar member. Therefore, no confusing pointer is there. Is it correct?
Thanks again for the help
really appreciated
Johnny
|
|
|
|
|
J.B. wrote:
it works out nicely except a small fix for me to get it compiled -
Arr well, when you write code without a compiler one error isn't bad i suppos
As a general rule of thumb, it's only the classes that interact with Windows etc that will cause you problems (this isn't a golden rule by anymeans) and out of those window classes, it's the ones that are more than just a thin wrapper round the Win32 API that cause problems. For example, CEdit is just a very thin wrapper around a edit control, and works fine, as you found out CStatusBar is more than that - and gives you problems. Its usually the classes that do anything at all with handle maps that don't work - as these are always local to the thread, and since your control is subclassed (by means of a DDX_Control statment) in your main thread,it's handle resides in that threads handle map.
As for the ones that do work - yes, it is safe to use them, but - you have the usual thread issues to think about. MFC classes are thread safe at the class level, but not the object level - IE to different instaces of a the same class provide no problems, but sharing the same instance might. It really depends on your app. You may find you need to use critical sections or other thread sync primatives to protect your control across threads, but you may be able to do without. It's all about thinking about what each thread is doing to the control - usually if one thread is just updating some text in the control, and the other is showing that text, you can get away without them. Where as if both theads are say updating the control's text, you shoud use a critical section to ensure they don't access the control at the same time.
J.B. wrote:
In my case, the changing of statusbar's text is done by its belonging class (my main class) with the original statusbar member. Therefore, no confusing pointer is there. Is it correct?
Sorry, but I really don't unstand what you mean by that?! Is what correct?!
|
|
|
|
|
Diddy wrote:
J.B. wrote:
In my case, the changing of statusbar's text is done by its belonging class (my main class) with the original statusbar member. Therefore, no confusing pointer is there. Is it correct?
Sorry, but I really don't unstand what you mean by that?! Is what correct?!
Thanks for the reply again, Diddy.
As you stated here that the classes that are always local to the thread don't work well, SendMessage() can be used to let one class to tell the other class (of the statusbar member) to perfrom some functions *locally*. And so it'd work. Whereas my original method was trying the directly access the member residing in one thread from another thread. I just want to make sure I've understood that what SendMessage() actually does A communicate link where different classes or threads will talk to each other and ask to perform some local functions.
Thanks,
Johnny
|
|
|
|
|
Hi i am deveoping namespace extension and i want to have web view kinda interface on my view side, For that which interface should i implement ?
Thank You.
Toughest Steel Comes From Hottest Furnance
|
|
|
|
|
plz give me example on creating web server that can serve dynamic page. I've already succeded using CreateProcess on C++ to serve PHP page. But how can i serve ASP page? are there ASP on windows that can be treated like CGI? or I must use ISAPI filter
If i must use ISAPI to serve ASP, plz give some advise or example!
THX A LOT, I REALLY NEED IT (for school task)
donald
|
|
|
|
|
If you want to server ASP, you should install IIS, it comes free with Windows 2000, and XP Pro. But you should also ask your class to move into the 21st century, ASP is dead, and good thing too.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
no no...you don't know what i meant. I want to create(write code) web server using c++. just like IIS, but it can run independently(on diff port). now i want my web server can accept ASP or PHP page like what IIS does.
yeah, my school is a little bit ....but, that's the homework. thx anyway.
donald
|
|
|
|
|
Could anyone give me an example?
|
|
|
|
|
Simple.
You use RegisterHotKey to register a new, global, system wide hotkey that can be used to send a predefined WM_HOTKEY message to the targetted window.
For example, this code piece creates a hotkey ALT+Z for the calling thread.
RegisterHotKey(NULL, 0x0010, MOD_ALT, VK_Z); Now, whenever you press ALT+Z, a WM_HOTKEY message is generated and posted into the calling thread's message queue. You can then create a message-map entry for MFC applications using
BEGIN_MESSAGE_MAP( CMyWindow )
ON_MESSAGE( WM_HOTKEY, HandleHotKeyPress )
END_MESSAGE_MAP See ON_COMMAND for information about the declaration of the handler function. It generally is a function taking two parameters of type WPARAM and LPARAM and returning a UINT or a boolean value. It might also return nothing.
You should store the hotkey identifier (0x0010) into a global variable, like a const UINT . This way you can call the UnregisterHotKey by using a constant instead of a raw number. Always remember to call the unregistration function when you no longer need the hotkey. Otherwise your application will fail to register a hotkey, because it's already reserved. Also, keeping the hotkey association active without having the target handler available may cause a system crash on Windows 95/98/Me.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Thanks, Antti.
I create an HandleHotKeyPress like this:
void CMainFrame::HandleHotKeyPress ()
{
MessageBox("aa");
}
It work with debug build, but crash when the second I press the hotkey with Release Build. What's the problem?
|
|
|
|
|
Hi,I'm looking for the way of getting information of Status of Object such as object creation,activation,deactivation etc..
I thought It would be possible to get that infomation Using CLSID of the Object.
But I couldn't find it at all.
Please Help me..
Any idea will be helpful.
|
|
|
|
|
You're obviously talking about COM+ ? Why not just create a log file in your class, and then write to it when those events are called, with a timestamp ?
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
I can't modify the Component.
I'd just like to monitor whether Objects are activated witout modifying components.
Please,Help me........
|
|
|
|
|
Check out the DevelopMentor site. I believe there is a generic "proxy" wrapper that provides COM interception. What it will do to performance is anyone's guess, and I imagine you might need to tailor it severely.
Steve S
|
|
|
|
|
Hello,
I am in the process of implementing a serial interface in my existing Visual C++ project by using the CSerialWnd functions as described in great detail in Ramon de Klein's contributed source code:
http://www.codeproject.com/system/serial.asp
I am able to perform the CSerialWnd::Open function on the COM1 port, and then expect to receive window notifications back in my main windows notification handler routine. I'm not a veteran Windows programmer so I may not have all the terminology exactly right. The call that I use to set that up is as follows:
lLastError = serial.Open ("COM1", hdlg, WM_NULL, 0, 2048, 2048);
if (lLastError != ERROR_SUCCESS)
here(0,"Error opening serial port");
lLastError = serial.Setup(CSerial::EBaud38400,CSerial::EData8,CSerial::EParNone,CSerial::EStop1);
if (lLastError != ERROR_SUCCESS)
here(0,"Error opening serial port");
lLastError = serial.SetupHandshaking(CSerial::EHandshakeSoftware);
if (lLastError != ERROR_SUCCESS)
here(0,"Error opening serial port");
lLastError = serial.SetupReadTimeouts(CSerial::EReadTimeoutNonblocking);
if (lLastError != ERROR_SUCCESS)
here(0,"Error opening serial port");
I have run this code in debug and verify that I can indeed open the COM1 port. When I had another application using the port the code would detect the error. Passing in WM_NULL as the 3rd parameter in the Open should cause Windows to use the default notification message number of CSerialWnd::mg_nDefaultComMsg. When I looked through the include files I never found an exact definition of what this was. That was how I intended to determine which messages in my notification handler came from the serial interface thread that gets created by the Open. I decided to step through the code and came across this section where it gets assigned:
long lLastError = CSerialEx::Open(lpszDevice,dwInQueue,dwOutQueue);
if (lLastError != ERROR_SUCCESS)
return lLastError;
// Save the window handle, notification message and user message
m_hwndDest = hwndDest;
m_nComMsg = nComMsg?nComMsg:mg_nDefaultComMsg;
m_lParam = lParam;
// Start the listener thread
lLastError = StartListener();
When I looked at m_nComMsg it has a value of 49839 after it gets set. The problem is, when I look at all the messages coming into my notification handler I don't have any that are 49839. There are lots of messages coming in that I believe are the result of my sending a couple "hello world" messages into the Windows program. But they have message ID's of like 307,309,312.
I started trapping all messages coming into the notification window and time stamping them. Before and after sending the "hello world" serial data in, I hit a button twice that causes the 1006 LOWORD value of wParam. I did this to make it easy to see where exactly I should have been seeing the serial data notifications. Below is the diagnostic notification information. I will only include one of the preceding and trailing 1006 messages to keep it short:
dlg Msg 149 is 273 WM_COMMAND hiword wParam = 0 loword wParam = 1006 at time Feb 3, 2004 2:54:40 PM 551 ms
dlg Msg 150 is 160 hiword wParam = 0 loword wParam = 18 at time Feb 3, 2004 2:54:41 PM 520 ms
dlg Msg 151 is 134 hiword wParam = 0 loword wParam = 0 at time Feb 3, 2004 2:54:42 PM 379 ms
dlg Msg 152 is 13 hiword wParam = 0 loword wParam = 510 at time Feb 3, 2004 2:54:42 PM 379 ms
dlg Msg 153 is 6 hiword wParam = 0 loword wParam = 0 at time Feb 3, 2004 2:54:42 PM 379 ms
dlg Msg 154 is 28 hiword wParam = 0 loword wParam = 0 at time Feb 3, 2004 2:54:42 PM 379 ms
dlg Msg 155 is 309 hiword wParam = 61185 loword wParam = 1563 at time Feb 3, 2004 2:54:42 PM 379 ms
dlg Msg 156 is 70 hiword wParam = 0 loword wParam = 0 at time Feb 3, 2004 2:54:42 PM 379 ms
dlg Msg 157 is 28 hiword wParam = 0 loword wParam = 1 at time Feb 3, 2004 2:54:42 PM 379 ms
dlg Msg 158 is 134 hiword wParam = 0 loword wParam = 1 at time Feb 3, 2004 2:54:42 PM 379 ms
dlg Msg 159 is 13 hiword wParam = 0 loword wParam = 510 at time Feb 3, 2004 2:54:42 PM 379 ms
dlg Msg 160 is 6 hiword wParam = 0 loword wParam = 1 at time Feb 3, 2004 2:54:42 PM 379 ms
dlg Msg 161 is 309 hiword wParam = 61185 loword wParam = 1563 at time Feb 3, 2004 2:54:42 PM 379 ms
dlg Msg 162 is 309 hiword wParam = 61185 loword wParam = 1563 at time Feb 3, 2004 2:54:42 PM 379 ms
dlg Msg 163 is 134 hiword wParam = 0 loword wParam = 0 at time Feb 3, 2004 2:54:42 PM 520 ms
dlg Msg 164 is 13 hiword wParam = 0 loword wParam = 510 at time Feb 3, 2004 2:54:42 PM 520 ms
dlg Msg 165 is 6 hiword wParam = 0 loword wParam = 0 at time Feb 3, 2004 2:54:42 PM 520 ms
dlg Msg 166 is 28 hiword wParam = 0 loword wParam = 0 at time Feb 3, 2004 2:54:42 PM 520 ms
dlg Msg 167 is 309 hiword wParam = 42497 loword wParam = 4230 at time Feb 3, 2004 2:54:42 PM 535 ms
dlg Msg 168 is 309 hiword wParam = 42497 loword wParam = 4230 at time Feb 3, 2004 2:54:42 PM 535 ms
dlg Msg 169 is 136 hiword wParam = 0 loword wParam = 4 at time Feb 3, 2004 2:54:44 PM 488 ms
dlg Msg 170 is 133 hiword wParam = 18692 loword wParam = 3958 at time Feb 3, 2004 2:54:44 PM 488 ms
dlg Msg 171 is 13 hiword wParam = 0 loword wParam = 510 at time Feb 3, 2004 2:54:44 PM 488 ms
dlg Msg 172 is 20 hiword wParam = 61185 loword wParam = 1563 at time Feb 3, 2004 2:54:44 PM 488 ms
dlg Msg 173 is 136 hiword wParam = 0 loword wParam = 4 at time Feb 3, 2004 2:54:44 PM 520 ms
dlg Msg 174 is 133 hiword wParam = 41476 loword wParam = 2319 at time Feb 3, 2004 2:54:44 PM 520 ms
dlg Msg 175 is 13 hiword wParam = 0 loword wParam = 510 at time Feb 3, 2004 2:54:44 PM 520 ms
dlg Msg 176 is 20 hiword wParam = 42497 loword wParam = 4230 at time Feb 3, 2004 2:54:44 PM 520 ms
dlg Msg 177 is 136 hiword wParam = 0 loword wParam = 4 at time Feb 3, 2004 2:54:44 PM 551 ms
dlg Msg 178 is 133 hiword wParam = 51972 loword wParam = 706 at time Feb 3, 2004 2:54:44 PM 551 ms
dlg Msg 179 is 13 hiword wParam = 0 loword wParam = 510 at time Feb 3, 2004 2:54:44 PM 551 ms
dlg Msg 180 is 20 hiword wParam = 61185 loword wParam = 1563 at time Feb 3, 2004 2:54:44 PM 551 ms
dlg Msg 181 is 136 hiword wParam = 0 loword wParam = 4 at time Feb 3, 2004 2:54:44 PM 582 ms
dlg Msg 182 is 133 hiword wParam = 43012 loword wParam = 1679 at time Feb 3, 2004 2:54:44 PM 582 ms
dlg Msg 183 is 13 hiword wParam = 0 loword wParam = 510 at time Feb 3, 2004 2:54:44 PM 582 ms
dlg Msg 184 is 20 hiword wParam = 61185 loword wParam = 1563 at time Feb 3, 2004 2:54:44 PM 582 ms
dlg Msg 185 is 310 hiword wParam = 61185 loword wParam = 1563 at time Feb 3, 2004 2:54:44 PM 582 ms
dlg Msg 186 is 15 hiword wParam = 0 loword wParam = 0 at time Feb 3, 2004 2:54:44 PM 582 ms
dlg Msg 187 is 136 hiword wParam = 0 loword wParam = 4 at time Feb 3, 2004 2:54:44 PM 598 ms
dlg Msg 188 is 133 hiword wParam = 22276 loword wParam = 1619 at time Feb 3, 2004 2:54:44 PM 598 ms
dlg Msg 189 is 13 hiword wParam = 0 loword wParam = 510 at time Feb 3, 2004 2:54:44 PM 598 ms
dlg Msg 190 is 20 hiword wParam = 15617 loword wParam = 2752 at time Feb 3, 2004 2:54:44 PM 598 ms
dlg Msg 191 is 310 hiword wParam = 15617 loword wParam = 2752 at time Feb 3, 2004 2:54:44 PM 598 ms
dlg Msg 192 is 15 hiword wParam = 0 loword wParam = 0 at time Feb 3, 2004 2:54:44 PM 598 ms
dlg Msg 193 is 136 hiword wParam = 0 loword wParam = 4 at time Feb 3, 2004 2:54:44 PM 613 ms
dlg Msg 194 is 133 hiword wParam = 57092 loword wParam = 2516 at time Feb 3, 2004 2:54:44 PM 613 ms
dlg Msg 195 is 13 hiword wParam = 0 loword wParam = 510 at time Feb 3, 2004 2:54:44 PM 613 ms
dlg Msg 196 is 20 hiword wParam = 42497 loword wParam = 4230 at time Feb 3, 2004 2:54:44 PM 613 ms
dlg Msg 197 is 310 hiword wParam = 42497 loword wParam = 4230 at time Feb 3, 2004 2:54:44 PM 613 ms
dlg Msg 198 is 15 hiword wParam = 0 loword wParam = 0 at time Feb 3, 2004 2:54:44 PM 613 ms
dlg Msg 199 is 136 hiword wParam = 0 loword wParam = 4 at time Feb 3, 2004 2:54:44 PM 645 ms
dlg Msg 200 is 133 hiword wParam = 37380 loword wParam = 1673 at time Feb 3, 2004 2:54:44 PM 645 ms
dlg Msg 201 is 13 hiword wParam = 0 loword wParam = 510 at time Feb 3, 2004 2:54:44 PM 645 ms
dlg Msg 202 is 20 hiword wParam = 10241 loword wParam = 2466 at time Feb 3, 2004 2:54:44 PM 645 ms
dlg Msg 203 is 310 hiword wParam = 10241 loword wParam = 2466 at time Feb 3, 2004 2:54:44 PM 645 ms
dlg Msg 204 is 15 hiword wParam = 0 loword wParam = 0 at time Feb 3, 2004 2:54:44 PM 645 ms
dlg Msg 205 is 136 hiword wParam = 0 loword wParam = 4 at time Feb 3, 2004 2:54:44 PM 660 ms
dlg Msg 206 is 133 hiword wParam = 10244 loword wParam = 1627 at time Feb 3, 2004 2:54:44 PM 660 ms
dlg Msg 207 is 13 hiword wParam = 0 loword wParam = 510 at time Feb 3, 2004 2:54:44 PM 660 ms
dlg Msg 208 is 20 hiword wParam = 42497 loword wParam = 4230 at time Feb 3, 2004 2:54:44 PM 660 ms
dlg Msg 209 is 310 hiword wParam = 42497 loword wParam = 4230 at time Feb 3, 2004 2:54:44 PM 660 ms
dlg Msg 210 is 15 hiword wParam = 0 loword wParam = 0 at time Feb 3, 2004 2:54:44 PM 660 ms
dlg Msg 211 is 136 hiword wParam = 0 loword wParam = 4 at time Feb 3, 2004 2:54:44 PM 692 ms
dlg Msg 212 is 133 hiword wParam = 30468 loword wParam = 2214 at time Feb 3, 2004 2:54:44 PM 692 ms
dlg Msg 213 is 13 hiword wParam = 0 loword wParam = 510 at time Feb 3, 2004 2:54:44 PM 692 ms
dlg Msg 214 is 20 hiword wParam = 10241 loword wParam = 2466 at time Feb 3, 2004 2:54:44 PM 692 ms
dlg Msg 215 is 310 hiword wParam = 10241 loword wParam = 2466 at time Feb 3, 2004 2:54:44 PM 692 ms
dlg Msg 216 is 15 hiword wParam = 0 loword wParam = 0 at time Feb 3, 2004 2:54:44 PM 692 ms
dlg Msg 217 is 136 hiword wParam = 0 loword wParam = 4 at time Feb 3, 2004 2:54:44 PM 707 ms
dlg Msg 218 is 133 hiword wParam = 38916 loword wParam = 1750 at time Feb 3, 2004 2:54:44 PM 707 ms
dlg Msg 219 is 13 hiword wParam = 0 loword wParam = 510 at time Feb 3, 2004 2:54:44 PM 707 ms
dlg Msg 220 is 20 hiword wParam = 42497 loword wParam = 4230 at time Feb 3, 2004 2:54:44 PM 707 ms
dlg Msg 221 is 310 hiword wParam = 42497 loword wParam = 4230 at time Feb 3, 2004 2:54:44 PM 707 ms
dlg Msg 222 is 15 hiword wParam = 0 loword wParam = 0 at time Feb 3, 2004 2:54:44 PM 707 ms
dlg Msg 223 is 136 hiword wParam = 0 loword wParam = 4 at time Feb 3, 2004 2:54:44 PM 770 ms
dlg Msg 224 is 133 hiword wParam = 40964 loword wParam = 1627 at time Feb 3, 2004 2:54:44 PM 770 ms
dlg Msg 225 is 13 hiword wParam = 0 loword wParam = 510 at time Feb 3, 2004 2:54:44 PM 770 ms
dlg Msg 226 is 20 hiword wParam = 42497 loword wParam = 4230 at time Feb 3, 2004 2:54:44 PM 770 ms
dlg Msg 227 is 310 hiword wParam = 42497 loword wParam = 4230 at time Feb 3, 2004 2:54:44 PM 770 ms
dlg Msg 228 is 15 hiword wParam = 0 loword wParam = 0 at time Feb 3, 2004 2:54:44 PM 770 ms
dlg Msg 229 is 136 hiword wParam = 0 loword wParam = 4 at time Feb 3, 2004 2:54:44 PM 801 ms
dlg Msg 230 is 133 hiword wParam = 33284 loword wParam = 2319 at time Feb 3, 2004 2:54:44 PM 801 ms
dlg Msg 231 is 13 hiword wParam = 0 loword wParam = 510 at time Feb 3, 2004 2:54:44 PM 801 ms
dlg Msg 232 is 20 hiword wParam = 61185 loword wParam = 1563 at time Feb 3, 2004 2:54:44 PM 801 ms
dlg Msg 233 is 310 hiword wParam = 61185 loword wParam = 1563 at time Feb 3, 2004 2:54:44 PM 801 ms
dlg Msg 234 is 15 hiword wParam = 0 loword wParam = 0 at time Feb 3, 2004 2:54:44 PM 801 ms
dlg Msg 235 is 136 hiword wParam = 0 loword wParam = 4 at time Feb 3, 2004 2:54:44 PM 879 ms
dlg Msg 236 is 133 hiword wParam = 12804 loword wParam = 1158 at time Feb 3, 2004 2:54:44 PM 879 ms
dlg Msg 237 is 13 hiword wParam = 0 loword wParam = 510 at time Feb 3, 2004 2:54:44 PM 879 ms
dlg Msg 238 is 20 hiword wParam = 10241 loword wParam = 2466 at time Feb 3, 2004 2:54:44 PM 879 ms
dlg Msg 239 is 310 hiword wParam = 10241 loword wParam = 2466 at time Feb 3, 2004 2:54:44 PM 879 ms
dlg Msg 240 is 15 hiword wParam = 0 loword wParam = 0 at time Feb 3, 2004 2:54:44 PM 879 ms
dlg Msg 241 is 136 hiword wParam = 0 loword wParam = 4 at time Feb 3, 2004 2:54:44 PM 895 ms
dlg Msg 242 is 133 hiword wParam = 46852 loword wParam = 2516 at time Feb 3, 2004 2:54:44 PM 895 ms
dlg Msg 243 is 13 hiword wParam = 0 loword wParam = 510 at time Feb 3, 2004 2:54:44 PM 895 ms
dlg Msg 244 is 20 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:54:44 PM 895 ms
dlg Msg 245 is 310 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:54:44 PM 895 ms
dlg Msg 246 is 15 hiword wParam = 0 loword wParam = 0 at time Feb 3, 2004 2:54:44 PM 895 ms
dlg Msg 247 is 136 hiword wParam = 0 loword wParam = 4 at time Feb 3, 2004 2:54:44 PM 957 ms
dlg Msg 248 is 133 hiword wParam = 55300 loword wParam = 2516 at time Feb 3, 2004 2:54:44 PM 957 ms
dlg Msg 249 is 13 hiword wParam = 0 loword wParam = 510 at time Feb 3, 2004 2:54:44 PM 957 ms
dlg Msg 250 is 20 hiword wParam = 42497 loword wParam = 4230 at time Feb 3, 2004 2:54:44 PM 957 ms
dlg Msg 251 is 310 hiword wParam = 42497 loword wParam = 4230 at time Feb 3, 2004 2:54:44 PM 957 ms
dlg Msg 252 is 15 hiword wParam = 0 loword wParam = 0 at time Feb 3, 2004 2:54:44 PM 957 ms
dlg Msg 253 is 136 hiword wParam = 0 loword wParam = 4 at time Feb 3, 2004 2:55:01 PM 832 ms
dlg Msg 254 is 133 hiword wParam = 36868 loword wParam = 3958 at time Feb 3, 2004 2:55:01 PM 832 ms
dlg Msg 255 is 13 hiword wParam = 0 loword wParam = 510 at time Feb 3, 2004 2:55:01 PM 832 ms
dlg Msg 256 is 20 hiword wParam = 61185 loword wParam = 1563 at time Feb 3, 2004 2:55:01 PM 832 ms
dlg Msg 257 is 310 hiword wParam = 61185 loword wParam = 1563 at time Feb 3, 2004 2:55:01 PM 832 ms
dlg Msg 258 is 70 hiword wParam = 0 loword wParam = 0 at time Feb 3, 2004 2:55:01 PM 832 ms
dlg Msg 259 is 28 hiword wParam = 0 loword wParam = 1 at time Feb 3, 2004 2:55:01 PM 832 ms
dlg Msg 260 is 134 hiword wParam = 0 loword wParam = 1 at time Feb 3, 2004 2:55:01 PM 832 ms
dlg Msg 261 is 13 hiword wParam = 0 loword wParam = 510 at time Feb 3, 2004 2:55:01 PM 832 ms
dlg Msg 262 is 6 hiword wParam = 0 loword wParam = 1 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 263 is 309 hiword wParam = 61185 loword wParam = 1563 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 264 is 160 hiword wParam = 0 loword wParam = 2 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 265 is 15 hiword wParam = 0 loword wParam = 0 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 266 is 309 hiword wParam = 61185 loword wParam = 1563 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 267 is 309 hiword wParam = 61185 loword wParam = 1563 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 268 is 307 hiword wParam = 61185 loword wParam = 1563 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 269 is 307 hiword wParam = 61185 loword wParam = 1563 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 270 is 311 hiword wParam = 61185 loword wParam = 1563 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 271 is 312 hiword wParam = 42497 loword wParam = 2229 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 272 is 78 hiword wParam = 0 loword wParam = 1000 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 273 is 309 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 274 is 312 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 275 is 309 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 276 is 309 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 277 is 307 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 278 is 307 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 279 is 307 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 280 is 307 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 281 is 307 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 282 is 307 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 283 is 307 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 284 is 307 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 285 is 312 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 286 is 312 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 287 is 312 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 288 is 307 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 289 is 307 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 290 is 307 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 291 is 307 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 292 is 312 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 293 is 309 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 294 is 307 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 295 is 307 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 296 is 312 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 297 is 312 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 298 is 312 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 299 is 312 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 300 is 312 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 301 is 307 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 302 is 307 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 303 is 307 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 304 is 307 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 305 is 312 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 306 is 312 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 307 is 307 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 308 is 307 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 309 is 307 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 310 is 307 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 311 is 312 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 312 is 312 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 313 is 307 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 314 is 307 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 315 is 307 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 316 is 307 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 317 is 312 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 318 is 312 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 319 is 312 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 320 is 312 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 321 is 312 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 322 is 312 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 323 is 312 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 324 is 312 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 325 is 309 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 326 is 309 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 327 is 309 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 328 is 309 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 329 is 309 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 330 is 309 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 331 is 312 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 332 is 307 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 333 is 307 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:55:01 PM 848 ms
dlg Msg 334 is 160 hiword wParam = 0 loword wParam = 2 at time Feb 3, 2004 2:55:01 PM 910 ms
dlg Msg 335 is 160 hiword wParam = 0 loword wParam = 2 at time Feb 3, 2004 2:55:02 PM 004 ms
dlg Msg 336 is 160 hiword wParam = 0 loword wParam = 2 at time Feb 3, 2004 2:55:02 PM 113 ms
dlg Msg 337 is 160 hiword wParam = 0 loword wParam = 2 at time Feb 3, 2004 2:55:02 PM 207 ms
dlg Msg 338 is 160 hiword wParam = 0 loword wParam = 2 at time Feb 3, 2004 2:55:02 PM 301 ms
dlg Msg 339 is 160 hiword wParam = 0 loword wParam = 2 at time Feb 3, 2004 2:55:02 PM 301 ms
dlg Msg 340 is 160 hiword wParam = 0 loword wParam = 2 at time Feb 3, 2004 2:55:02 PM 332 ms
dlg Msg 341 is 160 hiword wParam = 0 loword wParam = 2 at time Feb 3, 2004 2:55:02 PM 348 ms
dlg Msg 342 is 33 hiword wParam = 33 loword wParam = 3652 at time Feb 3, 2004 2:55:10 PM 317 ms
dlg Msg 343 is 309 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:55:10 PM 317 ms
dlg Msg 344 is 309 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:55:10 PM 410 ms
dlg Msg 345 is 309 hiword wParam = 23809 loword wParam = 2460 at time Feb 3, 2004 2:55:10 PM 426 ms
dlg Msg 346 is 273 WM_COMMAND hiword wParam = 0 loword wParam = 1006 at time Feb 3, 2004 2:55:10 PM 426 ms
I pushed a button on the GUI that caused the 1006 notification at 2:54:40, the 2 serial strings were sent in at 2:54:50 and 2:55:00. The next 1006 button push was done at 2:55:10. As you can see, the 1006 notifications came in almost exactly when they should have. The data between that reflects the serial data do not appear at 2:54:50 and 2:55:00.
The main question that I have though, is why don't the serial interface notifications have a dialog message type of 49839 like I expect. Also, the different types of serial message notifications are supposed to come in as the LOWORD of wParam. This is an enumerated type defined in WinBase.h where received data is a 1, sent data complete is 4, break received is 64, etc. But the data that I am getting in wParam is nothing like these, even if you account for the fact that multiple bits might be set at the same time.
I did find another example of a similar implementation at this web page:
http://www.icculus.org/~lucasw/School%20Projects/478/PCinterface/ffconst.cpp
Any help would be greatly appreciated. As I mentioned I am not a Windows programmer. My background is real time single board computer embedded systems using vxWorks. The learning curve is pretty steep for the Visual C++ GUI code.
Robert
|
|
|
|
|
Just wanted to let you all know that I figured out the problem in case someone comes upon this thread in the future. The problem that I was having is that my declaration:
CSerialWnd serial;
Was located in the InitDialogProc routine which would get called from the main dialog processing routine upon receipt of the WM_INITDIALOG notification. I moved that declaration to be global and I started receiving serial notifications in the main dialog processing routine. Now I will be able to write the code that handles the serial data stream.
Good Luck,
Robert
|
|
|
|
|
Hi,
I am using Visula C++ 6.0. I want to print a document to a printer. But I want to print to using a specific paper tray of the printer. I can not user prinet dialog, as I want to add this code in a service application.
Thanks
Asawari
Asawari
|
|
|
|
|
You'll need to setup the DEVMODE struct to point to the paperbin that you want to use. See MSDN and search for DEVMODE.
onwards and upwards...
|
|
|
|
|
Hi,
I want to filter all the windows messages to my MFC application before dispatching them to the main window or its child windows. I decided to override the PreTranslateMessage of my main application (CWinApp) to filter these messages. It works fine for the main frame window, menu, etc. I can capture all the mouse clicks, key presses, etc on the main frame, and its child dialog windows.
However, if my customized dialog classes are inherited from CFileDialog, CPageSetupDialog, CPrintDialog, etc, (all those subclasses of CCommonDialog), the PreTranslateMessage will not capture the messages for
these types of dialogs. It seems only work when my dialog classes are inherited from CDialog directly.
Does any one know how to fix this ? I don't want to add specific event handlers to each of these dialogs cause i don't to duplicate my filter code everywhere. Thanks for your help in advance.
Best Regards,
Benny Levin
|
|
|
|
|