Click here to Skip to main content
15,891,316 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: how to convert word file in to xml using c/c++ Pin
Richard MacCutchan4-Mar-14 2:49
mveRichard MacCutchan4-Mar-14 2:49 
GeneralRe: how to convert word file in to xml using c/c++ Pin
krishnaprasad t4-Mar-14 20:13
krishnaprasad t4-Mar-14 20:13 
GeneralRe: how to convert word file in to xml using c/c++ Pin
Richard MacCutchan4-Mar-14 22:26
mveRichard MacCutchan4-Mar-14 22:26 
SuggestionRe: how to convert word file in to xml using c/c++ Pin
David Crow4-Mar-14 7:30
David Crow4-Mar-14 7:30 
Questionuse of %u Pin
Member 106394643-Mar-14 4:00
Member 106394643-Mar-14 4:00 
AnswerRe: use of %u Pin
jeron13-Mar-14 4:17
jeron13-Mar-14 4:17 
AnswerRe: use of %u Pin
«_Superman_»3-Mar-14 14:57
professional«_Superman_»3-Mar-14 14:57 
Question[MFC]no subclass, no derivation, just redirect one function of CButton, is it possible? Pin
Falconapollo2-Mar-14 17:21
Falconapollo2-Mar-14 17:21 
As shown below, there are a few functions in CButton, but i want to change its behaviour by dealing with
C++
virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
. Yes, just this one and only one functon. It would generate more code than expected if I derive a class from CButton. I wonder if it possible to process this function without Subclass, and not use derivation. If so, how?

Remarks: I must use MFC, it's so hard to use pure Win32 API.

C++
class CButton : public CWnd
{
    DECLARE_DYNAMIC(CButton)

// Constructors
public:
    CButton();
    virtual BOOL Create(LPCTSTR lpszCaption, DWORD dwStyle,
                const RECT& rect, CWnd* pParentWnd, UINT nID);

// Attributes
    UINT GetState() const;
    void SetState(BOOL bHighlight);
    int GetCheck() const;
    void SetCheck(int nCheck);
    UINT GetButtonStyle() const;
    void SetButtonStyle(UINT nStyle, BOOL bRedraw = TRUE);

    HICON SetIcon(HICON hIcon);
    HICON GetIcon() const;
    HBITMAP SetBitmap(HBITMAP hBitmap);
    HBITMAP GetBitmap() const;
    HCURSOR SetCursor(HCURSOR hCursor);
    HCURSOR GetCursor();

#if (_WIN32_WINNT >= 0x501)
    AFX_ANSI_DEPRECATED BOOL GetIdealSize(_Out_ LPSIZE psize) const;
    AFX_ANSI_DEPRECATED BOOL SetImageList(_In_ PBUTTON_IMAGELIST pbuttonImagelist);
    AFX_ANSI_DEPRECATED BOOL GetImageList(_In_ PBUTTON_IMAGELIST pbuttonImagelist) const;
    AFX_ANSI_DEPRECATED BOOL SetTextMargin(_In_ LPRECT pmargin);
    AFX_ANSI_DEPRECATED BOOL GetTextMargin(_Out_ LPRECT pmargin) const;
#endif  // (_WIN32_WINNT >= 0x501)

#if ( _WIN32_WINNT >= 0x0600 ) && defined(UNICODE)
    CString GetNote() const;
    _Check_return_ BOOL GetNote(_Out_z_cap_(*pcchNote) LPTSTR lpszNote, _Inout_ UINT* pcchNote) const;
    BOOL SetNote(_In_z_ LPCTSTR lpszNote);
    UINT GetNoteLength() const;
    BOOL GetSplitInfo(_Out_ PBUTTON_SPLITINFO pInfo) const;
    BOOL SetSplitInfo(_In_ PBUTTON_SPLITINFO pInfo);
    UINT GetSplitStyle() const;
    BOOL SetSplitStyle(_In_ UINT nStyle);
    BOOL GetSplitSize(_Out_ LPSIZE pSize) const;
    BOOL SetSplitSize(_In_ LPSIZE pSize);
    CImageList* GetSplitImageList() const;
    BOOL SetSplitImageList(_In_ CImageList* pSplitImageList);
    TCHAR GetSplitGlyph() const;
    BOOL SetSplitGlyph(_In_ TCHAR chGlyph);
    BOOL SetDropDownState(_In_ BOOL fDropDown);

    // Sets whether the action associated with the button requires elevated permissions.
    // If elevated permissions are required then the button should display an elevated icon.
    HICON SetShield(_In_ BOOL fElevationRequired);
#endif // ( _WIN32_WINNT >= 0x600 ) && defined(UNICODE)

// Overridables (for owner draw only)
    virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);

// Implementation
public:
    virtual ~CButton();
protected:
    virtual BOOL OnChildNotify(UINT, WPARAM, LPARAM, LRESULT*);
};

AnswerRe: [MFC]no subclass, no derivation, just redirect one function of CButton, is it possible? Pin
Richard MacCutchan2-Mar-14 22:35
mveRichard MacCutchan2-Mar-14 22:35 
GeneralRe: [MFC]no subclass, no derivation, just redirect one function of CButton, is it possible? Pin
Falconapollo2-Mar-14 22:38
Falconapollo2-Mar-14 22:38 
GeneralRe: [MFC]no subclass, no derivation, just redirect one function of CButton, is it possible? Pin
Richard MacCutchan2-Mar-14 23:47
mveRichard MacCutchan2-Mar-14 23:47 
AnswerRe: [MFC]no subclass, no derivation, just redirect one function of CButton, is it possible? Pin
CPallini2-Mar-14 22:45
mveCPallini2-Mar-14 22:45 
AnswerRe: [MFC]no subclass, no derivation, just redirect one function of CButton, is it possible? Pin
«_Superman_»3-Mar-14 17:12
professional«_Superman_»3-Mar-14 17:12 
QuestionGood way to optimize or replace a nested for loop? Pin
NilssonCreative2-Mar-14 14:37
professionalNilssonCreative2-Mar-14 14:37 
AnswerRe: Good way to optimize or replace a nested for loop? Pin
«_Superman_»2-Mar-14 15:48
professional«_Superman_»2-Mar-14 15:48 
GeneralRe: Good way to optimize or replace a nested for loop? Pin
NilssonCreative3-Mar-14 6:20
professionalNilssonCreative3-Mar-14 6:20 
GeneralRe: Good way to optimize or replace a nested for loop? Pin
«_Superman_»3-Mar-14 14:53
professional«_Superman_»3-Mar-14 14:53 
GeneralRe: Good way to optimize or replace a nested for loop? Pin
NilssonCreative3-Mar-14 16:07
professionalNilssonCreative3-Mar-14 16:07 
QuestionAdding new GUID to uuids.h and the new library won't link Pin
Vaclav_1-Mar-14 7:48
Vaclav_1-Mar-14 7:48 
AnswerRe: Adding new GUID to uuids.h and the new library won't link Pin
«_Superman_»1-Mar-14 20:46
professional«_Superman_»1-Mar-14 20:46 
GeneralRe: Adding new GUID to uuids.h and the new library won't link SOLVED Pin
Vaclav_2-Mar-14 5:37
Vaclav_2-Mar-14 5:37 
GeneralRe: Adding new GUID to uuids.h and the new library won't link SOLVED Pin
Vaclav_2-Mar-14 7:11
Vaclav_2-Mar-14 7:11 
JokeRe: Adding new GUID to uuids.h and the new library won't link SOLVED Pin
«_Superman_»2-Mar-14 15:43
professional«_Superman_»2-Mar-14 15:43 
QuestionCircular buffer for file Pin
Dansveen28-Feb-14 10:36
Dansveen28-Feb-14 10:36 
AnswerRe: Circular buffer for file Pin
CPallini28-Feb-14 12:44
mveCPallini28-Feb-14 12:44 

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.