|
you need to use a rich edit control, which is an extension to the edit control. This is the control that you get in wordpad.
If you are using MFC there is a class CRichEdit[^].
This can mostly be used like a standard edit control, however yo set or get the text you need to use streaming functions otherwise the markup will show as plain text.
see CRichEditCtrl::StreamIn[^] for setting the text and CRichEditCtrl::StreamOut[^] for reading text with its formatting tags
An alternate would be a html control. There are quite a few articles on codeproject with samples.
|
|
|
|
|
C language program.
Project launched three stepper motor, uln2803, parallel port.
|
|
|
|
|
|
|
Hi
I need help...
I have an array of string private variable List<String^>^ CalculateGreeks_; having property for get and set List<String^>^ CalculateGreeks() in a class CArgsRequestCredential,
I want to put these variables
PV,Delta,Vega
in my local object
<b>ReqCredObj_ = gcnew Args::CArgsRequestCredential();</b>
first i need to split strings saving each string in a variable and then storing variables in the list..
my code is
<b>List<String^>^ CalculateGreeks1 = gcnew List<String^>();
for(int i = 0 ; i <= LocalArray->GetUpperBound(0);i++)
{
//
//CalculateGreeks1->Add(ii);
String^ Test = Convert::ToString(LocalArray->GetValue(i,0));
array <String ^>^ strings = Test->Split(',');
//ii = gcnew List<String^>^ CalculateGreeks_();
//ii->CalculateGreeks = Convert::ToString(strings);
// CalculateGreeks1->Add(strings);
// ReqCredObj_->CalculateGreeks = Convert::ToString(LocalArray->GetValue(0,1));
}
</b>
but my logic is not giving correct values
kindly help
|
|
|
|
|
This has already been posted to the Managed forum.
I must get a clever new signature for 2011.
|
|
|
|
|
around 100,000 items are added to a CListCtrl.
before adding, I call ShowWindow(SW_HIDE), this function reduces nearly 1/6 time used.
LockWindowUpdate() and ValidateRect() do not reduce time at all.
Do you have idea to add huge items to CListCtrl faster?
|
|
|
|
|
1. Call SetRedraw(FALSE) before adding
2. For best possible speed use virtual listctrl
|
|
|
|
|
Great answer.
Chris Meech
I am Canadian. [heard in a local bar]
In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]
|
|
|
|
|
SetRedraw(FALSE) is no better than ShowWindow(SW_HIDE), and there is no double effects when call both - time reduced is same as by calling ShowWindow(SW_HIDE).
I think there should be other ways for faster adding items.
|
|
|
|
|
includeh10 wrote: I think there should be other ways for faster adding items.
Yes, there is a much, much faster way. The secret? Don't add them at all. Instead, use a virtual listctrl to supply the items "on demand".
Anytime you try to add > 1000 items you will see slowdown. Adding 100,000 items will be incredibly annoying to your users.
|
|
|
|
|
It depends of course on the goal of your program, but 100,000 items seems an excessive amount; the most notable speed improvement would come from not adding so many items. If this were possible, it would also speed things up later when you're scrolling the view, selecting items, deleting selections etc.
Maybe it would be useful to add some filter functionality, this would both help the loading time and help the user find what he wants more easily.
modified 13-Sep-18 21:01pm.
|
|
|
|
|
|
Hi All,
If a process creats a threads and then detaches that thread. Now If I kill my process then in this case will my thread run upto its completion ?
|
|
|
|
|
pandit84 wrote: If a process creats a threads and then detaches that thread.
I have no idea what this means.
pandit84 wrote: Now If I kill my process then in this case will my thread run upto its completion ?
If it is a native application, then every other thread created within the application will be killed abruptly when the main thread comes to a halt. If you want a graceful exit, you need to take care of that yourself.
For example:
UINT AdditionalThread(LPVOID p)
{
return 0;
}
int main()
{
_beginthread(AdditionalThread, 0, 0);
return 0;
}
"Real men drive manual transmission" - Rajesh.
|
|
|
|
|
Rajesh R Subramanian wrote: If it is a native application, then every other thread created within the application will be killed abruptly when the main thread comes to a halt.
Technically this actually isn't the case, although from C/C++ it generally is (unless you take unusual measures). See here[^] for a more complete explaination.
Steve
|
|
|
|
|
Stephen Hewitt wrote: See here[^] for a more complete explaination.
I love it. One of the posts on that link says "Win32 is a component of the .NET system". Dang! I've been programming .NET all this time! So there, Nish.
|
|
|
|
|
There is an open secret in Redmond that .NET has build-in time travel, if you don't believe me, what do you think the "T" on .NET stands for?
|
|
|
|
|
Threads can not be detatched from the containing process. A process provides the context the threads runs in (such as the address space) and it doesn't really even make sense to consider a thread without one.
Steve
|
|
|
|
|
As others have correctly pointed out, user mode threads always runs in the context of its process and cannot be detached.
However you can create a kernel mode thread using PsCreateSystemThread[^] which does not run in any process context.
But you can only call this routine from driver code.
|
|
|
|
|
how to get the upper bound and lower bound of an array
BYTE *pByte = new BYTE[64];
Some Day I Will Prove MySelf :: GOLD
modified on Friday, February 4, 2011 8:37 AM
|
|
|
|
|
goldenrose9 wrote: BYTE *pByte = new BYTE[64];
You are allocating the array, then it is your responsibility to keep the bounds as 0 and 64.
|
|
|
|
|
I think you mean 0 and 63.
I must get a clever new signature for 2011.
|
|
|
|
|
yes.. of course it is!! thanks for pointing about that small but BIG mistake..
|
|
|
|
|
My pleasure; it's your turn to catch me out next time.
I must get a clever new signature for 2011.
|
|
|
|