|
Hmm, are you exiting your program right after the create thread?
If so, then your thread probably doesn't even have the chance to execute.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
And where is the Wait... call here?
I vote pro drink
|
|
|
|
|
That is what I realized too. Hopefully there is more to the program than just those lines.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
Yes, but he called CloseHandle right after creating the thread
I vote pro drink
|
|
|
|
|
It doesn't stop the thread. I found much evidence on groups.google.com that if you don't care about syncing on the handle, then closing it right after creation is very common.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
I do end the program after I create the thread what do I do to give it time to execute? No one mentioned this when I was reading up on threads...
What should I do put a sleep in?
|
|
|
|
|
Did that work for you? I received some kind of memory leak... Does this sound familiar?
|
|
|
|
|
cout , printf , same sh*t. As a matter of fact, cout uses printf to perform its job (or at least fome function from stdio.h .
Michel
If I am wrong or said something stupid, I apologize in advance
|
|
|
|
|
Just forget CreateThread, and use _beginthreadex instead.
I vote pro drink
|
|
|
|
|
Do as he said.
Michel
If I am wrong or said something stupid, I apologize in advance
|
|
|
|
|
Hi!
I want to try and override OnPaint() of my tree ctrl. I have never done tried redrawing myself before and is new to me. Could anyone please tell me all the things that has to be taken care of while doing this? If there is site somewhere for beginners with this, do let me know.
NC
|
|
|
|
|
Are you *really* going to draw tree control yourself? The lines, +/- buttons, icons, text?
If not, you may consider custom-draw, which allows you to draw only selected parts.
Tomasz Sowinski -- http://www.shooltz.com ** If you're going to rape, pillage and burn, be sure to do things in that order. **
|
|
|
|
|
Hi!
Thanks for writing back.
This is what I want to do. I am not sure what to use - custom draw or owner draw. Maybe you can tell me what is best.
I don't have the +/- signs in my tree. I have an image list associated with the tree. Some items have icons and some don't. For those items with icons, I want to display the icon and the text a few pixels right to where the tree ctrl draws it, basically indent further.
Any ideas on how to do this?
NC
|
|
|
|
|
So all you need is extra indentation for tree items? Or you just want to display something in this extra space?
Anyway, go with custom-draw. There's no owner-draw for tree controls; you'd have to paint everything yourselft; in such case why would you need the tree control? Just for item storage?
Tomasz Sowinski -- http://www.shooltz.com ** If you're going to rape, pillage and burn, be sure to do things in that order. **
|
|
|
|
|
Hi!
Thanks again!
Yes, all I need is extra indentation for some items.
I tried custom draw, and got the item text to be indented. But the icon is shown at the same place as it was before. And I am not sure how to redraw the icon. This is where I am struck at, right now.
How can I redraw the icon?
Thanks,
NC
|
|
|
|
|
NC wrote:
Yes, all I need is extra indentation for some items.
The extra indentation is always identical? Or varies between items?
Tomasz Sowinski -- http://www.shooltz.com ** If you're going to rape, pillage and burn, be sure to do things in that order. **
|
|
|
|
|
Hi!
It has to be x + the current indentation. So, basically for items with icons, I need to get the current indentation of the item with respect to its parent(which is fine) and add a constant to it and indent by that much. This constant is same for all items.
Thanks,
NC
|
|
|
|
|
Before continuing with custom-draw (CTreeCtrl::GetImageList and CImageList::Draw will greatly help there) consider using item state images. Each item can have two icons; if you'll have empty state icon you can use it as simulated indent.
Tomasz Sowinski -- http://www.shooltz.com ** If you're going to rape, pillage and burn, be sure to do things in that order. **
|
|
|
|
|
Hi!
Is it possible to have more than 2 icons? I have a state image as well.
Thanks,
NC
|
|
|
|
|
No, AFAIK only two.
Indent must be on the left side of icons, right? You can't simply add extra spaces into item text. In such case you'll have to custom-draw.
Tomasz Sowinski -- http://www.shooltz.com ** If you're going to rape, pillage and burn, be sure to do things in that order. **
|
|
|
|
|
Hi!
So, I guess it is Custom draw for me then! Do you know of any sites which show how do this? I looked on this forum and couldn't find any. I have never done this, so I don't even know how to start to draw the icon.
Thanks for all your help,
NC
|
|
|
|
|
|
Thanks, I'll try that.
NC
|
|
|
|
|
hi there
i need some help on figuring out how to make one of my Bitmap resources the background of my dialog window. I am really stuck! Can somebody please help me on figuring out how to do this.
I really dont wanna use someone elses class that they created i just want to know how to do it. Please if you have any instructions on how to do this i would greatly appreciate it.
Thanks again!
|
|
|
|
|