Click here to Skip to main content
15,914,481 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHuffman coding Pin
krish_amrita5-Apr-09 6:15
krish_amrita5-Apr-09 6:15 
AnswerRe: Huffman coding Pin
Cedric Moonen5-Apr-09 7:20
Cedric Moonen5-Apr-09 7:20 
AnswerRe: Huffman coding Pin
Luc Pattyn5-Apr-09 8:25
sitebuilderLuc Pattyn5-Apr-09 8:25 
AnswerRe: Huffman coding Pin
Stuart Dootson5-Apr-09 11:46
professionalStuart Dootson5-Apr-09 11:46 
QuestionHow to override TR1 "function class"' operator()(****)//many parameters ? Thanks! The code is as follows. Pin
yjred5-Apr-09 5:20
yjred5-Apr-09 5:20 
AnswerRe: How to override TR1 "function class"' operator()(****)//many parameters ? Thanks! The code is as follows. Pin
Stuart Dootson5-Apr-09 11:50
professionalStuart Dootson5-Apr-09 11:50 
QuestionCTabCtrl Usage. Pin
FISH7865-Apr-09 2:57
FISH7865-Apr-09 2:57 
QuestionRe: CTabCtrl Usage. Pin
yjred5-Apr-09 5:03
yjred5-Apr-09 5:03 
My english is pool, I can't explain for english. so I put code to you!

class CProperty1Dlg : public CDialog
{
// Construction
public:
CProperty1Dlg(CWnd* pParent = NULL); // standard constructor

// Dialog Data
//{{AFX_DATA(CProperty1Dlg)
enum { IDD = IDD_PROPERTY1_DIALOG };
CButton m_button2;
CButton m_button1;
CTabCtrl m_tab;
//}}AFX_DATA

// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CProperty1Dlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL

// Implementation
protected:
HICON m_hIcon;

// Generated message map functions
//{{AFX_MSG(CProperty1Dlg)
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
afx_msg void OnSelchangeTab1(NMHDR* pNMHDR, LRESULT* pResult);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};


CProperty1Dlg::CProperty1Dlg(CWnd* pParent /*=NULL*/)
: CDialog(CProperty1Dlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CProperty1Dlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}

void CProperty1Dlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CProperty1Dlg)
DDX_Control(pDX, IDC_BUTTON2, m_button2);
DDX_Control(pDX, IDC_BUTTON1, m_button1);
DDX_Control(pDX, IDC_TAB1, m_tab);
//}}AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(CProperty1Dlg, CDialog)
//{{AFX_MSG_MAP(CProperty1Dlg)
ON_NOTIFY(TCN_SELCHANGE, IDC_TAB1, OnSelchangeTab1)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CProperty1Dlg message handlers

BOOL CProperty1Dlg::OnInitDialog()
{
CDialog::OnInitDialog();

// Add "About..." menu item to system menu.

// IDM_ABOUTBOX must be in the system command range.
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000);

CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
CString strAboutMenu;
strAboutMenu.LoadString(IDS_ABOUTBOX);
if (!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
}
}

// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon

// TODO: Add extra initialization here
m_tab.InsertItem( 0, _T("Tab1") );
m_tab.InsertItem( 1, _T("Tab2") );
m_button2.ShowWindow( SW_HIDE );

return TRUE; // return TRUE unless you set the focus to a control
}




void CProperty1Dlg::OnSelchangeTab1(NMHDR* pNMHDR, LRESULT* pResult)
{
// TODO: Add your control notification handler code here
int sel = m_tab.GetCurSel();

switch(sel)
{
case 0:
m_button1.ShowWindow( SW_SHOW );
m_button2.ShowWindow( SW_HIDE );
break;
case 1:
m_button2.ShowWindow( SW_SHOW );
m_button1.ShowWindow( SW_HIDE );
break;
}

*pResult = 0;
}
AnswerRe: CTabCtrl Usage. Pin
FISH7865-Apr-09 6:24
FISH7865-Apr-09 6:24 
QuestionCRichEditCtl on CMDIchildWnd Pin
prithaa4-Apr-09 21:30
prithaa4-Apr-09 21:30 
Answeranother question Pin
Mohammadj5-Apr-09 0:26
Mohammadj5-Apr-09 0:26 
GeneralRe: another question Pin
Iain Clarke, Warrior Programmer5-Apr-09 12:20
Iain Clarke, Warrior Programmer5-Apr-09 12:20 
GeneralRe: another question Pin
Mohammadj7-Apr-09 0:39
Mohammadj7-Apr-09 0:39 
GeneralRe: another question Pin
Iain Clarke, Warrior Programmer7-Apr-09 10:57
Iain Clarke, Warrior Programmer7-Apr-09 10:57 
GeneralRe: another question Pin
Mohammadj8-Apr-09 2:52
Mohammadj8-Apr-09 2:52 
Questioninverse mapping Pin
Member 33753344-Apr-09 17:35
Member 33753344-Apr-09 17:35 
AnswerRe: inverse mapping Pin
Iain Clarke, Warrior Programmer6-Apr-09 2:05
Iain Clarke, Warrior Programmer6-Apr-09 2:05 
AnswerRe: inverse mapping Pin
Alan Balkany7-Apr-09 4:27
Alan Balkany7-Apr-09 4:27 
QuestionWindows Example Programs Pin
BobInNJ4-Apr-09 12:08
BobInNJ4-Apr-09 12:08 
QuestionRe: Windows Example Programs Pin
David Crow4-Apr-09 17:05
David Crow4-Apr-09 17:05 
AnswerRe: Windows Example Programs Pin
BobInNJ5-Apr-09 11:14
BobInNJ5-Apr-09 11:14 
JokeRe: Windows Example Programs Pin
Steve Echols4-Apr-09 22:49
Steve Echols4-Apr-09 22:49 
QuestionOpenGL in a MFC dialog using vc98 Pin
yousuf_22794-Apr-09 7:46
professionalyousuf_22794-Apr-09 7:46 
AnswerRe: OpenGL in a MFC dialog using vc98 Pin
BobInNJ4-Apr-09 12:46
BobInNJ4-Apr-09 12:46 
GeneralRe: OpenGL in a MFC dialog using vc98 Pin
yousuf_22794-Apr-09 20:17
professionalyousuf_22794-Apr-09 20:17 

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.