|
Andy202 wrote: Are they problems with several ProcessMessages...
Other than PeekMessage() being old and antiquated? Yes. If you happen to have (in the future) an active modeless dialog, there is no call to IsDialogMessage() . Is PumpMessage() dispatching its own messages?
While it's ultimately up to you as to how you want to handle event notification, I personally would not opt for this route.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
If I understand your code correctly, when the external event occurs, a message is posted/sent to the dialog. Is this correct? If so, you don't need keep calling PeekMessage(). GetMessage() will wait until there is a message in the que and only return if there is.
Also you say 'tabbed dialog' Do you mean a window with a tab control, or a series of windows? If you have one main window, which controls your dialogs, then you only need one message pump. If you are dialing with several windows, then create a "message only window" which handles the message pump and dispatches the message to the correct child dialog. Either way, you only need one message pump.
|
|
|
|
|
Thanks for your post.
I am using the CTabCtrl class from the Code Project, which has a dialog for each Tab.
For the case of Timers, I handle these time events in the controller Tab, should I just need to place the ProcessMessage() in this place also.
I did have 2 ProcessMessage() in different Tabs, but the progra, runs slow.
Andy (at home)
|
|
|
|
|
Hi all,
Have some basic questions related to MFC….
1. Which are the DLLs that are used in a simple application that I created thr VC++6.0.? I know MFC42.DLL which are the other important ones?
2. In which DLL the definition of WinMain(),DefWindowProc() is provided? I know that I can’t edit it but just to have basic information…
3. What is the effect of various setting under ProjectSettingsGeneral tabMicrosoft foundation classes
i. Use MFC in a shared DLL,
ii. ii. Use MFC in Static library,
iii. iii. Not using MFC
Thanks
Sameer
|
|
|
|
|
1. Read the documentation
2. I don't know and don't care
3. Using MFC shared DLL's allows your application to use the MFC classes and minimizes the size of your EXE. Static linking of the MFC libraries results in linking the MFC libraries into your EXE build. Therefore the EXE is larger but not dependent on MFC being installed on the machine. Not using MFC means your application cannot use the MFC classes.
led mike
|
|
|
|
|
To add to mikes reply,
Sameer_Thakur wrote: 1. Which are the DLLs that are used in a simple application that I created thr VC++6.0.? I know MFC42.DLL which are the other important ones?
Use dependency walker to check dll's used
|
|
|
|
|
What do you need exactly?
|
|
|
|
|
Hi Iam using Grid control in my application.
how to delete the multiple rows in the Grid.
currently if i select multiple rows to delete but the last selected row is getting deleted.here iam sending the code what i have used to delete the rows.but it is working
pls any body can help in this
CCellRange cRange;
int nCount = 0;
UINT unSel = 0;
INT_PTR nSelctedDMItemsCount = 0;
cRange = m_Grid.GetSelectedCellRange();
nCount = cRange.GetMaxRow();
bool bFlag = false;
for(int nDMIdx = 1;nDMIdx < nCount;nDMIdx++)
{
bFlag =false;
bFlag = m_Grid.IsCellSelected(nDMIdx,0);
if(bFlag )
{
m_Grid.DeleteRow( nDMIdx );
}
}
|
|
|
|
|
reddy harish wrote: Hi Iam using Grid control
What Grid Control?
led mike
|
|
|
|
|
Iam using CGrid control.in this iam facing the problem
|
|
|
|
|
|
Hi,
I created a CDateTimeCtrl control on my view. It is a 24 hour time format. But it still displays AM/PM . If it is 24 hr clock them AM/PM is not necessary there. SO I want to remove the AM/Pm text from control. How can I do this?
Regards,
Hemant Kulkarni.
|
|
|
|
|
use CDateTimeCtrl::SetFormat to change this behaviour
nave
|
|
|
|
|
Thanks!
I got the solution
It is just to change the SetFormat() finction and not to pass tt t options in string
|
|
|
|
|
Hello,
porting my sipmle (hope, C++ standard conforming) console programs from VC++ 2003 to VC++2005 I found out that I can't read unsigned int from the stream if there is a comma after it.
...main...{
unsigned int ui=2345;
cin >> ui;
cout << ui; // still will show 2345 on input "1,1"
}
Input "1,1" prevents reading 1 to ui. The reason is that deep inside the num_get class of the VC2005 iostream library thinks that in the current locale comma is thousand separator. But there is no reason for it. (I don't even mention locales in my program, so it should be standard "C" locale.)
Any sensible suggestions? I want (and could before) reading
// This also affects boost::uBLAS library at matrix input.
Regards,
Alex
|
|
|
|
|
wrote: (I don't even mention locales in my program, so it should be standard "C" locale.)
That's a bold (and invalid) assumption. The locale is set by the OS. It's up to the programmer
to ensure that locale-specific functions are behaving as expected.
|
|
|
|
|
Well, thanks for your answer anyway.
In fact, it was a sort of VC2005 bug. Service Pack helped me.
As far as I know, the C++ program should start with standard "C" locale no matter the OS reports.
Best regards,
Alex
|
|
|
|
|
|
Thank you very much for the info!
As I mentioned in prev message, SP1 fixes the bug.
Regards,
Alex
|
|
|
|
|
Could any1 plz tell me how can i get current time in milliseconds.
thanks.
|
|
|
|
|
ikbahrian wrote: get current time in milliseconds.
SYSTEMTIME st;
GetSystemTime(&st);
I hope this helps.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
|
Hi. Im using VC6 and trying to swap byte as the file is little endian.
<br />
while (j < 20)<br />
{ <br />
array[j] = file.get();<br />
j++;<br />
}<br />
<br />
j = 0;<br />
<br />
for (i=0; i<10; i++)<br />
{<br />
swap[i] = ((int)array[j+1] << 8) + array[j];
j = j + 2;<br />
}<br />
Is the swapping method correct? Coz I cant seem to get the correct ans.
|
|
|
|
|
array is a char array ? and swap is an int array ? int is four bytes, not two. Try a short array, or just swap in place
for (i=0; i<10; i+=2)<br />
{<br />
byte temp = array[i];<br />
array[i] = array[i+1];<br />
array[i+1] = temp;<br />
}<br />
<br />
That's more efficient than doing shifts as well, I would presume.<br />
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
yeah. array is a char array and swap is an int array.
Im opening a file stream to read in some bytes like: 2E FA CC F6 9F FC and store it in array. So since its little endian, I want to swap the position of the first element of array with the position of the second element of array. And then store both array[0] and array[1] into int swap[0] to do some calculation.
That can be done right? since int is 4 bytes which is equalvalent to 2 char.
What is the best way to do that?
|
|
|
|