|
You can try reading the USERDOMAIN environment variable...
People that start writing code immediately are programmers (or hackers), people that ask questions first are Software Engineers - Graham Shanks
|
|
|
|
|
Hi!
Could anybody suggest me some good books, or free tutorials about MACROS IN vc++.
tHANX
"If you change then change for the good."
|
|
|
|
|
Try here[^]. Boost is full of goodies, simply reading the Boost documentation makes you a better programmer and gives you ideas.
Steve
|
|
|
|
|
I am tryin out a control array with edit boxs, but i encounter the following when i click on class wizard : "Parsing Error: "Expected";" ,Input line CEDIT m_id[17]; "
Can someone tell me what went wrong here ?
|
|
|
|
|
I think you are not allowed to use an array etc inside the ClassWizard's area. I would suggest putting it outside of the ClassWizard's block like:
...<br />
CEdit m_id[17];
this is this.
|
|
|
|
|
|
Hello... can you please tell me how to make a program that will draw graphs.. by given data? This is just a simple graph...
|
|
|
|
|
Hi,
If u r looking for 2D graph, check this link NTGraph[^]
Bye,
Cool Ju
Dream Ur Destiny
|
|
|
|
|
Try this
http://www.codeproject.com/docview/graphfx.asp
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
XMinds
|
|
|
|
|
Hello... can you please tell me how to make a program that will draw graphs.. by given data? This is just a simple graph...
|
|
|
|
|
|
Hi all,
I developed a Dialog based application that has several timers. My app priodically post some message to another modelless dialog (monitor dialog).
But I found that every time user press and hold mouse buttons on control box of the dialog (System menu, minimize, maximize button) of hold right mouse button on title bar, all timer blocked and no message is posted to the monitor dialog.
I also tried to move timers to another separated thread in a SDI application but problem remains the same.
Did anyone face this problem before? Any solution to this??
Thank you for your precious time on my post.
Have a good time!
Kemi
|
|
|
|
|
I made a test app and didn't experience any such problems. Can you give more details?
Steve
|
|
|
|
|
Hi Steve,
Thank you for your reply. OKey. I will discrible my situation in more details:
My App consists of 2 dialogs: main dialog and the Monitor dialog.
- Main dialog has a timer (started in OnInitDialog with enlapse time = 100ms). When the time enlapsed, PostMessage to Monitor dialog.
- Monitor dialog: modelless dialog created and shown in OnInitDialog of the main dialog, contains a ListControl. Every time when receives a message from Main dialog, insert a new string to the list control (such as "New message from main dialog" )
When I run app, the list control on Monitor dialog continuously filled with new rows. But when I PRESS and HOLD left mouse button on control boxes or PRESS and HOLD right mouse button on Title bar of the main dialog, The list control stops adding new rows until the mouse released. => My app somehow blocked!!
That's my problem. Is this clear? Any suggestion?
Thanks,
Have a good time!
KEMI
-- modified at 0:51 Tuesday 7th February, 2006
|
|
|
|
|
What kind of timer are you using. I use the SetTimer API which posts a WM_TIMER message to my window. Are you calling PostMessage explictly?
Steve
|
|
|
|
|
I used SetTimer() API too.
Well, wouldit be easier if I post some code here?
Main dialog:
BOOL CTestDlg::OnInitDialog()<br />
{<br />
CDialog::OnInitDialog();<br />
SetIcon(m_hIcon, TRUE);
SetIcon(m_hIcon, FALSE);
<br />
m_TimerId = SetTimer(1, 300, NULL);<br />
<br />
if (!::IsWindow(m_monitorDlg.GetSafeHwnd()))<br />
m_monitorDlg.Create(IDD_DIALOG_MONITOR, this); <br />
m_monitorDlg.ShowWindow(SW_SHOW);<br />
<br />
return TRUE;
}<br />
void CTestDlg::OnTimer(UINT nIDEvent) <br />
{<br />
if (nIDEvent == 1)<br />
::PostMessage(m_monitorDlg.GetSafeHwnd(), WM_USER+1, 0, 0);<br />
CDialog::OnTimer(nIDEvent);<br />
}
Monitor Dialog:
LRESULT CMonitorDlg::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) <br />
{<br />
if (message == WM_USER+1)<br />
{<br />
m_list.InsertItem(0, "New message from Main dialog!");<br />
} <br />
return CDialog::WindowProc(message, wParam, lParam);<br />
}
In my opinion, it's all clear and simple. Any idea pls?!
Have a good time!
KEMI
|
|
|
|
|
I think it is because of the timer messages stop coming when you press and hold the left or right mouse buttons on the title bar etc. Then when you release the button, all the messages arrive that were stuck in the queue.
The solution could be to use multi-media timers.
this is this.
|
|
|
|
|
I have an app I wipped up and the timer messages arrive just find when I'm dragging the dialog.
Steve
|
|
|
|
|
Yes, the timer messages come just fine when dragging the window, but when you have the left button down on the Control-box the X button etc, that they stop. Also when you keep your Right-button down on the title-bar, that they stop coming as well.
this is this.
|
|
|
|
|
You're right. I didn't know that. You live and learn.
Steve
|
|
|
|
|
I've tried with multi-media timer already in SDI test application. It SEEMED work.
But when pressing and hold mouse buttons on title bar, application still blocked. And when mouse released, I found that some messages was added to list control in a batch. It seems like the message was queued and the interface still looks blocked. That not what I expected to see.
Thanks for your suggestion. Any other ideas?
Have a good time!
KEMI
|
|
|
|
|
I think you should check it again. I tried using the MM timer with a callback function and it worked well:
void CALLBACK MyTymer(UINT uTimerID, UINT uMsg, DWORD_PTR dwUser, DWORD_PTR dw1, DWORD_PTR dw2)
Now that is the callback. You could start the timer using:
timeSetEvent(1000,1,MyTymer,(DWORD)this,TIME_PERIODIC | TIME_CALLBACK_FUNCTION);
Notice the this as the user-argument. It will come to the Callback in the dwUser parameter. You can use it to call any parent's function from the Callback.
It does seem to be working.
this is this.
|
|
|
|
|
Ok, I missed the redraw part.
It seems that some controls do not draw properly during the blocking time.
You can try:
m_List.RedrawWindow(); to force a redraw. It should work.
this is this.
|
|
|
|
|
I added m_List.RedrawWindow(); right after m_list.InsertItem(0, "New message from Main dialog!");
But it still does not work. Messages are only inserted to list when mouse released as a bundle.
Have a good time!
KEMI
|
|
|
|
|
I have never tried with sending messages, which may be the problem. However, I used the member variables of the second dialog directly:
Here, m_Second is the second dialog.
CMainDlg* p = (CMainDlg*)dwUser;<br />
p->m_Second.m_List2.InsertItem(0,"Some text");<br />
p->m_Second.m_List2.RedrawWindow();
Still I am confused. I do suspect the PostMessage() etc to be the problem. Maybe.
this is this.
|
|
|
|