Click here to Skip to main content
16,010,394 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralRe: stl use <list> Pin
nne-vitamin22-Dec-05 2:44
nne-vitamin22-Dec-05 2:44 
GeneralRe: stl use <list> Pin
toxcct22-Dec-05 2:51
toxcct22-Dec-05 2:51 
GeneralRe: stl use <list> Pin
Axter25-Dec-05 1:06
professionalAxter25-Dec-05 1:06 
QuestionRefer MSDN code, but STL's operator () has problem! Pin
simonchen.net14-Dec-05 18:30
simonchen.net14-Dec-05 18:30 
AnswerRe: Refer MSDN code, but STL's operator () has problem! Pin
toxcct15-Dec-05 0:41
toxcct15-Dec-05 0:41 
AnswerRe: Refer MSDN code, but STL's operator () has problem! Pin
SilentSilent15-Dec-05 0:46
SilentSilent15-Dec-05 0:46 
QuestionTo change the color of Button Pin
srimayank11_codeproject14-Dec-05 3:19
srimayank11_codeproject14-Dec-05 3:19 
AnswerRe: To change the color of Button Pin
Jörgen Sigvardsson14-Dec-05 9:21
Jörgen Sigvardsson14-Dec-05 9:21 
srimayank11_codeproject wrote:
I need to color a button using ATL, WTL or WIN 32 API..I can easily do it using MFC but because of the Application requirementI have to do it by using the above mentioned technologies only.

Here's a good start with WTL:
class CColorButton : public CWindowImpl<CColorButton, CButton> {
public:
   DECLARE_WND_SUPERCLASS(_T("CColorButton"), _T("BUTTON"))
   
   // Don't forget REFLECT_NOTIFICATIONS() in the parent window message map!
   BEGIN_MSG_MAP(CColorButton)
      MSG_OCM_DRAWITEM(OnDrawItem)
   END_MSG_MAP()
   
public:
   void OnDrawItem(UINT uCode, LPDRAWITEMSTRUCT pdis) {
      // Do your owner draw painting here, as prescribed by the MSDN docs
   }
};


Please note that you will have to make your button BS_OWNERDRAW (window style flag). This unfortunately makes the button unable to work properly as a default button. If you need this functionality, I can provide that code as well. I just wanted to make this code as simple and easy to understand as possible, as it illustrates how to draw the button yourself easily. Also, please do not forget to add REFLECT_NOTIFICATIONS() in your parents message handler. If you don't, your button will not be drawn.. at all! Smile | :)

--
Pictures[^] from my Japan trip.
QuestionVS 2005, Boost and STLPort Pin
Rob Caldecott14-Dec-05 2:26
Rob Caldecott14-Dec-05 2:26 
AnswerRe: VS 2005, Boost and STLPort Pin
Jörgen Sigvardsson14-Dec-05 9:10
Jörgen Sigvardsson14-Dec-05 9:10 
GeneralRe: VS 2005, Boost and STLPort Pin
Rob Caldecott14-Dec-05 11:38
Rob Caldecott14-Dec-05 11:38 
GeneralRe: VS 2005, Boost and STLPort Pin
Nemanja Trifunovic15-Dec-05 1:47
Nemanja Trifunovic15-Dec-05 1:47 
GeneralRe: VS 2005, Boost and STLPort Pin
Jörgen Sigvardsson15-Dec-05 3:24
Jörgen Sigvardsson15-Dec-05 3:24 
GeneralRe: VS 2005, Boost and STLPort Pin
Nemanja Trifunovic15-Dec-05 4:41
Nemanja Trifunovic15-Dec-05 4:41 
GeneralRe: VS 2005, Boost and STLPort Pin
Jörgen Sigvardsson15-Dec-05 4:59
Jörgen Sigvardsson15-Dec-05 4:59 
GeneralRe: VS 2005, Boost and STLPort Pin
Nemanja Trifunovic15-Dec-05 7:19
Nemanja Trifunovic15-Dec-05 7:19 
AnswerRe: VS 2005, Boost and STLPort Pin
Stuart Dootson14-Dec-05 21:42
professionalStuart Dootson14-Dec-05 21:42 
AnswerRe: VS 2005, Boost and STLPort Pin
Nemanja Trifunovic15-Dec-05 1:56
Nemanja Trifunovic15-Dec-05 1:56 
GeneralRe: VS 2005, Boost and STLPort Pin
Rob Caldecott15-Dec-05 2:18
Rob Caldecott15-Dec-05 2:18 
QuestionHow to pass Structures/Types as parameters in COM DLL function? Pin
karnav zaveri11-Dec-05 20:30
karnav zaveri11-Dec-05 20:30 
AnswerRe: How to pass Structures/Types as parameters in COM DLL function? Pin
Starick11-Dec-05 22:09
Starick11-Dec-05 22:09 
QuestionRogueWave ToolsVC? Pin
Ed K9-Dec-05 5:11
Ed K9-Dec-05 5:11 
Questionatlbase.h line 758 assertion failed Pin
hardworkboy7-Dec-05 21:59
hardworkboy7-Dec-05 21:59 
AnswerRe: atlbase.h line 758 assertion failed Pin
Lim Bio Liong7-Dec-05 22:29
Lim Bio Liong7-Dec-05 22:29 
GeneralRe: atlbase.h line 758 assertion failed Pin
hardworkboy12-Dec-05 21:02
hardworkboy12-Dec-05 21:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.