|
What does "fails" mean?
Doesn't compile? Crashes at runtime? Nothing happens?
It marks the area for updating. The next WM_PAINT message will
update that area. If the same exact data is drawn as on the last WM_PAINT,
you're not going to see a difference.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I Mean nothin happens!
Ahhh the InvalidateRect() hasn't to do something with the text printed in the RTFCtrl on the View ???!!!
What can i do that i can see a little difference ?????
Many many thanx for your help and best regards
Croc
|
|
|
|
|
CrocodileBuck wrote: What can i do that i can see a little difference ?
You need to change something between calls to UpdateAllViews() if
you want to see something different in the view. What are your views
drawing? Something from the document? If so, change the document.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I will only print Text (SetWindowText) in the View !!!????
Many many thanks and best regards
Croc
|
|
|
|
|
Only you know what's going on in your views.
The text data must be coming from somewhere...
Change it and update the views!
And make sure changing it doesn't already cause an update implicitly,
or you still won't see anything.
If the view is a window not in your control (where you don't do the painting,
like an edit control), then you may not have control over updating regions of
the window.
If you are doing the painting in your view, look at the invalid rect in the WM_PAINT
handler - you should see that your update rect is there. What you do with that info in
your painting code is up to you.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Ok. Thanx, iwill try it !
Tomorrow i will mail my success or ... ;(
Many many thanx and best regards
Croc
|
|
|
|
|
You are in deep deep sh*t at this point dude. Maybe you should just treat the buck to a Filet-O-Fish and call it a day.
I'm outta here, have a great weekend!
led mike
|
|
|
|
|
Cheers!
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
The Server stalled posting this one, (and crashed my Laptop) Tought it was Lost.
Good for You, Enjoy
Bram van Kampen
modified on Saturday, July 12, 2008 9:02 PM
|
|
|
|
|
led mike wrote: I'm outta here, have a great weekend!
Just Enjoy, You Deserve.
Wish I was there thoug,
Regards
Bram van Kampen
|
|
|
|
|
What class is your view derived from?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
|
CrocodileBuck wrote: fom CView !
And you're using SetWindowText() ? I've not ever tried that, but it just seems odd.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Sry, i was too fast, but your version won't work Too !
Thax for all your help & best regards
Croc
|
|
|
|
|
I inserted a shockwaveflash activex control in my project, and it works.
How to find the file (eg. .ocx)? The "Insert ActiveX Control" dialog shows no path info.
system
|
|
|
|
|
Working with EVc++4 on ARMV4I device.
I have an CArray :
CArray<CStockEntry, CStockEntry> stockArr;
void SetCStockEntryArr(CArray<CStockEntry, CStockEntry>& arr);
CArray<CStockEntry, CStockEntry>& GetStockEntryArr();
in my .cpp:
void DeptStock::SetCStockEntryArr(CArray<CStockEntry, CStockEntry>& arr) {
for (int i=0; i <= arr.GetUpperBound(); i++) {
CStockEntry se = arr.GetAt(i);
this->stockArr.Add(se);
}
CString s1 = _T("Size of copied Array & Org:");
s1.Format(_T("%s %d %d"), s1, stockArr.GetSize(), arr.GetSize());
AfxMessageBox(s1);
s1.Empty();
return;
}
CArray<CStockEntry, CStockEntry>& DeptStock::GetStockEntryArr() {
CString s1 = _T("Size of Returning Array:");
s1.Format(_T("%s %d"), s1, stockArr.GetSize());
AfxMessageBox(s1);
s1.Empty();
return this->stockArr;
}
In between Set & Get I don't perform any operations on the stockArr.
Why is while set, it is stored properly, but while retriing I get an empty array.
Any help is appreciated.
Thanks
Terry
|
|
|
|
|
I tested your code as follows:
struct CStockEntry
{
int entry;
CStockEntry(int i = 0) {entry = i;}
};
class DeptStock
{
public:
CArray<CStockEntry, CStockEntry> stockArr;
void SetCStockEntryArr(CArray<CStockEntry, CStockEntry>& arr)
{
for (int i=0; i <= arr.GetUpperBound(); i++)
{
CStockEntry se = arr.GetAt(i);
this->stockArr.Add(se);
}
CString s1 = _T("Size of copied Array & Org:");
s1.Format(_T("%s %d %d"), s1, stockArr.GetSize(), arr.GetSize());
AfxMessageBox(s1);
s1.Empty();
return;
}
CArray<CStockEntry, CStockEntry>& GetStockEntryArr()
{
CString s1 = _T("Size of Returning Array:");
s1.Format(_T("%s %d"), s1, stockArr.GetSize());
AfxMessageBox(s1);
s1.Empty();
return this->stockArr;
}
};
...
CArray<CStockEntry, CStockEntry> stockArr;
stockArr.Add(CStockEntry(0));
stockArr.Add(CStockEntry(1));
stockArr.Add(CStockEntry(2));
stockArr.Add(CStockEntry(3));
stockArr.Add(CStockEntry(4));
DeptStock test;
test.SetCStockEntryArr(stockArr);
CArray<CStockEntry, CStockEntry> &stockArrRef = test.GetStockEntryArr();
It works fine.
What aren't you showing?
FWIW, calling Empty() on those local CStrings is unnecessary.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi Mark,
If I add objects in array like you are adding, then my code is working perfect. But I am working different way. In my GUI, I add objects in the array in my GUI CPage4 (m_page4 member var), then on Ok button I create DeptStock deptStock object & SetCStockEntryArr(m_page4.GetStockEntries()).
TILL this things are fine.
Then I pass deptStock to a file to store the object details in file.
g_dbOperations.Write_StockTextFile(deptStock);
void DbOperations::Write_StockTextFile(DeptStock deptStock) {
.........
CString toWrite;
int index = -1;
OperatorDetails od = deptStock.GetOperator();
DeptDetails dd = deptStock.GetDept();
CArray<cstockentry,>& stockArr = deptStock.GetStockEntryArr();
CString str(_T("Stock Size:"));
str.Format(_T("%s %d \n %s %d"), str, stockArr.GetSize(), _T("Dept Stock Arr "), deptStock.GetStockEntryArr().GetSize());
AfxMessageBox(str);
This is how the flow is. If I remove the above comments of adding objects od CStockEntry to stockArr, it gives proper results. But I have already added the array elements & not able to retrive.
I have given a better & clear picture of the flow of my program & error point. Hope you can help me out to track the problem.
Thanks
Terry
|
|
|
|
|
Trupti Mehta wrote: If I add objects in array like you are adding, then my code is working perfect.
That should help you track it down. If your array is empty, debug the code
that's supposed to populate it...why are no items added?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I am displaying some text in a window.
I want to have a text cursor when I click the mouse left button.
How can I do this?
danginkgo
|
|
|
|
|
danginkgo wrote: I am displaying some text in a window.
I want to have a text cursor when I click the mouse left button.
How can I do this?
Well it's called a Caret, but if you are trying to create your own text editing window you have a lot of work to do.
SetCaretPos[^]
led mike
|
|
|
|
|
Hi,
i want to draw the graph in excel by parsing file,
so when i have parsed the data, in that period i want to hide the construction of the graph between the parsing process completion,In Excel we can write this script to hide the Macro:
Application.ScreenUpdating = false or true,
and between this processing period we can show message in status bar by using this
Application.StatusBar = "Now processing File "
Application.StatusBar = false;
i want to do this in the C++, Is that any method available in that which can corelate the same functionality as like as excel scripting..
Thanks in advance,
Regards,
Vimal
|
|
|
|
|
|
Hi,
I have thread running. It will EnterCriticalSection at some poit. This works perfectly alright on Windows XP or lower versions of OS. But it is not working on Vista. Sometime it works but sometimes it doesn't. It always stuck at EnterCriticalSection(). It is not able to get the ownership. I have written code like:
pReadList->Request(); //This function calls EnterCriticalSection(. But it will always stuck on Vista.
if( some condition )
{
//some action
}
pReadList->Release() //This function calls LeaveCriticalSection() API.
Please help.
Thanks
|
|
|
|
|
SRKSHOME wrote: This works perfectly alright
Extremely unlikely. "Appears to work perfectly" is probably more accurate.
You don't show any relevant code, so it's tough to offer any kind of help.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|