|
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++
|
|
|
|
|
Here is sample code. Please help
void DSReadableConnectionThread::RemoveConnection( const DSReadableConnection &connection )
{
pReadList->Request(); /*Request()calls ::EnterCriticalSection().This works in windows xp and below versions of OS. But it is not working on Vista. It contineously wait at EnterCriticalSection().
pNewConnectionList>Request();*/
if( !pReadList->Remove(connection) )
{
pNewConnectionList->Remove( connection );
}
// If no connections to process then put ThreadMain() to sleep
if( pReadList->isEmpty()&& pNewConnectionList->isEmpty() )
{
ready.ClearSignal();
}
pNewConnectionList->Release();
pReadList->Release();
}
|
|
|
|
|
The only way this can happen is if another thread is already "in" the
critical section. But that wouldn't work on any OS.
If you can put together a project that builds and fails that will run on
my machine, I can take a look. Otherwise it's really hard to debug from here
There's still no relevant code I've seen. Is the critical section initialized properly
before any thread tries to enter it?
Are you positive it's deadlocking at the EnterCriticalSection?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I checked it again. Initialization of critical section is properly done.
Here is actual code goes..
inline void Request() const
{
EnterCriticalSection( &_section ); //Here actually it stuck on Vista.
::InterlockedIncrement(&m_nLockCount);
}
If some other thread is using this crititcal section,it shouldn't have worked on any other os also.But it is working perfectly except on Vista.
Is there any change on Vista architecture in threading and synchronization. Something is mentioned in this link: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=510229&SiteID=1
Do you have any idea on this?
|
|
|
|
|
The only difference in Vista is the threading is more efficient.
The changes can expose problems in improperly written threading code
(not as many problems as multi-core machines expose ).
You've got some kind of deadlock. Maybe put TRACE statements before
and after EVERY enter/leave of the critical section and see if you can find
it. I don't know what else to say except you need to debug it.
Why the InterlockedIncrement() call? What is the critical section protecting?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|