|
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!
|
|
|
|
|
|
hi there
i need some help on figuring out how to make one of Bitmap resources the background of my dialog window. I am really stuck! Can somebody please help me on figuring out how to do this.
Thanks again!
|
|
|
|
|
As a starting point, you can check the demo application of the CButtonST class. One of its pages has a bitmapped background.
Bye!
SoftechSoftware
Davide Calabro'
davide_calabro@yahoo.com
http://www.softechsoftware.it
|
|
|
|
|
This is a problem I've had before, but I just can't seem to figure it
out:
I have a dialog (CDlgIEAddText) that modifys properties of a class
(CIELayerText), and I have created a member variable in (CIELayerText)
of type (CDlgIEAddText*) .
I have included the DlgIEAddText.h header file, but the compiler keeps
saying "ielayertext.h(26) : error C2501: 'CDlgIEAddText' : missing
storage-class or type specifiers"
Does anyone know why I can't declare this pointer even though I have
included the header file??
Thanks!
Here's the CIELayerText.h file and error the compiler generates:
*** HEADER FILE ***
// IELayerText.h: interface for the CIELayerText class.
//
//////////////////////////////////////////////////////////////////////
#if
!defined(AFX_IELAYERTEXT_H__29E5E993_F1E6_4F27_BEA6_DC5C4380E20D__INCL
UDED_)
#define
AFX_IELAYERTEXT_H__29E5E993_F1E6_4F27_BEA6_DC5C4380E20D__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "DlgIEAddText.h"
#include "IELayerObject.h"
class CIELayerText : public CIELayerObject
{
public:
void Properties(CWnd* pWnd);
void ContextMenu(CPoint point, CWnd* pWnd);
void Render(CDC* pDC);
BOOL Create(CString csText, CRect* pRect, LOGFONT* logfontFont,
COLORREF colorFG, COLORREF colorBG, DWORD dwAlign);
CIELayerText();
virtual ~CIELayerText();
private:
CDlgIEAddText *m_pDlg; // *** I can't declare this pointer, why not?
DWORD m_dwAlign;
CString m_csText;
LOGFONT m_logfontFont;
};
#endif //
!defined(AFX_IELAYERTEXT_H__29E5E993_F1E6_4F27_BEA6_DC5C4380E20D__INCL
UDED_)
|
|
|
|
|
I have no idea why #including file doesnt't work - maybe preprocessor symbol used to ensure that .h file is included only once is duplicated. But... you don't have to #include anything if you just want a pointer. Use forward declaration instead:
class CDlgIEAddText;
class CIELayerText
{
CDlgIEAddText *m_pDlg;
};
Tomasz Sowinski -- http://www.shooltz.com ** If you're going to rape, pillage and burn, be sure to do things in that order. **
|
|
|
|
|
if DlgIEAddText.h is included in a precompiled header (stdafx.h) you can get this kind of error. It happens because the .h file is not recompiled until you do a rebuild all.
Hope that helps
|
|
|
|