Vertical and Horizontal Scrollbar appears automatically when the text entered is more than the display area. This is working as expected.
I am having one clear button in my application which is to clear the text in rich edit control. But when i click the clear button vertical scrollbar disappears but the horizantal scrollbar is not disappearing.
It's not possible to access nodes by index. You must know the handle of the node. If you don't have records of the node handles, you can parse the tree:
// Start with the root item:
HTREEITEM hRoot = myTree.GetRootItem();
// Get the first child of the root:
HTREEITEM hChild1 = myTree.GetChildItem(hRoot);
// Move through the siblings until you reach the node you want:
HTREEITEM hChild2 = myTree.GetNextSiblingItem(hChild1)
HTREEITEM hChild3 = myTree.GetNextSiblingItem(hChild2)
HTREEITEM ItemFromIndex(int index)
HTREEITEM item = m_tree.GetRootItem();
while (item != NULL && index > 0)
item = NextTreeItem(item);
// if item is not NULL, you now have the HTREEITEM of the given indexreturn item;
HTREEITEM NextTreeItem(HTREEITEM hStartItem)
HTREEITEM hItem = hStartItem;
// move down to next level
HTREEITEM hChildItem = m_tree.GetChildItem(hItem);
hItem = hChildItem;
bool foundSibling = false;
while (!foundSibling && hItem != NULL)
// move along same level
HTREEITEM hSiblingItem = m_tree.GetNextItem(hItem, TVGN_NEXT);
if (hSiblingItem != NULL)
hItem = hSiblingItem;
foundSibling = true;
// nothing on same level so move up and try again
hItem = m_tree.GetParentItem(hItem);
Som eof this was written from memory, other sections are code pasts, so take with a pinch of salt.
Wow, it's awesome. Prettymuch all is their in your post. Thanks.
One more thing here too. I have just start to use MPLAB. Seems ok so far, and I'm writing a sample on it. But seems to me the results deals with the simulated environment. Is there anyway to deals with devices such as real PICs, LEDs and so on.
I appreciate your help all the time...
I have a Dialog based application, to transfer a file I am using a thread (say T1).
If I need to abort the T1 I need to press cancel button, for abort process I am using a memeber variable (bStopPushThread ) as a flag. If I set it ture it comes out of T1.
But my application getting hang. Code on Abort button click is below:
You probably have code looking like this in your thread:
while( !m_bStopPushThread )
// Do whatever the thread is supposed to do
Chances are that the m_bStopPushThread has been optimized into a register in your thread controlling loop which means that the thread won't see the value change.
This happens if the variable is not written to inside the loop.
Building a debug version disguises this behaviour since optimizations usually are turned off.
The remedy is to declare the variable m_bStopPushThread as volatile, which will tell the compiler to read its value from the variables memory address every time and not to hold its value in a register.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
If I had to guess, as someone already stated, g_hThreadHandlePush may not be the actual thread handle that you're expecting. To follow up on that, I hate to see people wait on something for an INFINITE time span. I know some disagree, but imagine if someone works on your code years later when you're not around and removes (for example) the m_bStopPushThread variable... they would end up with a freeze and it would be very hard to pinpoint where the freeze is occurring (debugging in multithreaded applications gets complex). I think you're better off setting a reasonable timeout, then alerting as to what occurred (using trace statements, message box, whatever).
I am using CRichEditCtrl. I need to add percentage in a loop at end of text.
Every time I need to call GetWindowText() and append text and again SetWindowText(), but due to this I am getting flickring.
How can I add only a single line og text in CRichEditCtrl so that I can avoid flickring.
Last Visit: 31-Dec-99 19:00 Last Update: 29-Jan-23 13:16