Now I am changeing the lblRecno value in the while loop:
int lp = 0;
CString newTxt = "";
But the new value lblRecno is displaying in the place of the previous value, an so on.
I think I should to use the WM_ERASEBKGND, but I don't know how to do it.
What you want actually to show the static text one after another.
If you just place a while loop you can see that last value only.
Try with a timer updating the window text in regular intervals say 1 sec
On the dialog window tehre is a Start button. When user click on the button:
iLicznik = 0;
newTxt = "";
// suppose: It is a database, and I am reading records
// and display the current recno number
for(iLicznik = 1; iLicznik <= 1000; iLicznik++)
Your code is doing exactly what it is supposed to do. Paint-related messages are low priority so they do not get handled if other, high-priority messages are in the queue. This is why you do not see the lblRecno control being updated until the end. Lose the timer stuff and try:
I have prob with pointer, in fact my principal class has a control activeX
witch i put it like variable m_DTC so it générate a class .cpp and .h
when I try to call it into a CDialog
i do like this :
in file .h Cmyinterface (class of control activeX) I put a pointer
and in the main class in boutton evenement i write
int nreponse =exple.DoModal();
I have a bug
"Exception non generated in 0x7c2090db (mfc70d.dll) in project.exe:0xC0000005: Violation of access when reading from the location 0xcccccd1c.
when i add other CDialog calling the interface i have the same prob
I hope that i exposed well my problem.
The first thing to do when you get such a crash is to start your debugger. You will get a lot of information (where the crash occurs exactly, what are the values of the variables and pointers, ...). It could be helpfull to see where it crashes exactly. You could also use the callstack to check in which of your functions the problem occurs.