Click here to Skip to main content
15,925,399 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: m_viewList variable Pin
Priyank Bolia5-May-05 0:09
Priyank Bolia5-May-05 0:09 
GeneralMSDN example chatsrvr Pin
microsoftcertificate4-May-05 13:52
sussmicrosoftcertificate4-May-05 13:52 
GeneralRe: MSDN example chatsrvr Pin
Michael Dunn4-May-05 16:33
sitebuilderMichael Dunn4-May-05 16:33 
GeneralA question on switching compilers... Pin
Brian R4-May-05 12:55
Brian R4-May-05 12:55 
GeneralRe: A question on switching compilers... Pin
David Crow5-May-05 3:08
David Crow5-May-05 3:08 
GeneralAuto-Completing CDataCombo Pin
Roshprog4-May-05 12:20
Roshprog4-May-05 12:20 
GeneralMenu reappears after being deleted Pin
elephantstar4-May-05 11:50
elephantstar4-May-05 11:50 
QuestionHow do I add text to a list control inside a property sheet? Pin
realius4-May-05 10:45
realius4-May-05 10:45 
What am I trying to do....
Using VC++ 6 and MFC
The application does several things. It receives 3 threads of information via a TCP/IP connection. It also monitors a directory for new files. All of the data is processed and logged as it is received. A worker thread handles the multiple threads.
A dialog box interface will be used to display a summary of the information. The dialog needs to be a property sheet (tab dialog) with a summary page listing all data from all sources. The other tabs are more detailed breakdowns of each type of data.
My problem is...
So far, I have been using a list control on each tab for the data display. However, I can't figure out how to get the data to display in the list.
If I create a list box on the main dialog, I can use AddString or InsertItem just fine. But when I try to do the same with my property pages it doesn't work.
Please help.

Confused | :confused:
// tryproppageDlg.cpp : implementation file<br />
//<br />
<br />
#include "stdafx.h"<br />
#include "tryproppage.h"<br />
#include "tryproppageDlg.h"<br />
#include "MyPage1.h"<br />
#include "MyPage2.h"<br />
<br />
//Globals<br />
HWND hwndTPPDlg;<br />
<br />
/////////////////////////////////////////////////////////////////////////////<br />
// CTryproppageDlg dialog<br />
<br />
CTryproppageDlg::CTryproppageDlg(CWnd* pParent /*=NULL*/)<br />
: CDialog(CTryproppageDlg::IDD, pParent)<br />
{<br />
//{{AFX_DATA_INIT(CTryproppageDlg)<br />
// NOTE: the ClassWizard will add member initialization here<br />
//}}AFX_DATA_INIT<br />
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);<br />
}<br />
void CTryproppageDlg:oDataExchange(CDataExchange* pDX)<br />
{<br />
CDialog:oDataExchange(pDX);<br />
//{{AFX_DATA_MAP(CTryproppageDlg)<br />
// NOTE: the ClassWizard will add DDX and DDV calls here<br />
//}}AFX_DATA_MAP<br />
}<br />
BEGIN_MESSAGE_MAP(CTryproppageDlg, CDialog)<br />
//{{AFX_MSG_MAP(CTryproppageDlg)<br />
//}}AFX_MSG_MAP<br />
END_MESSAGE_MAP()<br />
<br />
<br />
BOOL CTryproppageDlg::OnInitDialog()<br />
{<br />
CDialog::OnInitDialog();<br />
<br />
static CPropertySheet myPropSheet;<br />
static CMyPage1 myPage1;<br />
static CMyPage2 myPage2;<br />
myPropSheet.AddPage(&myPage1);<br />
myPropSheet.AddPage(&myPage2);myPropSheet.Create();<br />
myPage1.m_listctrl1.InsertItem(0,"stuff");<br />
return TRUE; // return TRUE unless you set the focus to a control<br />
}<br />
_________________________________________________________________<br />
<br />
// tryproppage.cpp : Defines the class behaviors for the application.<br />
//<br />
<br />
#include "stdafx.h"<br />
#include "tryproppage.h"<br />
#include "tryproppageDlg.h"<br />
<br />
/////////////////////////////////////////////////////////////////////////////<br />
// CTryproppageApp<br />
<br />
BEGIN_MESSAGE_MAP(CTryproppageApp, CWinApp)<br />
//{{AFX_MSG_MAP(CTryproppageApp)<br />
//}}AFX_MSG<br />
ON_COMMAND(ID_HELP, CWinApp::OnHelp)<br />
END_MESSAGE_MAP()<br />
<br />
/////////////////////////////////////////////////////////////////////////////<br />
// CTryproppageApp construction<br />
CTryproppageApp::CTryproppageApp()<br />
{<br />
}<br />
/////////////////////////////////////////////////////////////////////////////<br />
// The one and only CTryproppageApp object<br />
CTryproppageApp theApp;<br />
/////////////////////////////////////////////////////////////////////////////<br />
// CTryproppageApp initialization<br />
BOOL CTryproppageApp::InitInstance()<br />
AfxEnableControlContainer();<br />
// Standard initialization<br />
<br />
CTryproppageDlg dlg;<br />
m_pMainWnd = &dlg;<br />
int nResponse = dlg.DoModal();<br />
if (nResponse == IDOK)<br />
{<br />
}<br />
else if (nResponse == IDCANCEL)<br />
{<br />
}<br />
return FALSE;<br />
}<br />
<br />
// MyPage1.cpp : implementation file<br />
//<br />
<br />
_________________________________________________________________<br />
<br />
#include "stdafx.h"<br />
#include "tryproppage.h"<br />
#include "MyPage1.h"<br />
<br />
/////////////////////////////////////////////////////////////////////////////<br />
// CMyPage1 property page<br />
<br />
IMPLEMENT_DYNCREATE(CMyPage1, CPropertyPage)<br />
<br />
CMyPage1::CMyPage1() : CPropertyPage(CMyPage1::IDD)<br />
{<br />
//{{AFX_DATA_INIT(CMyPage1)<br />
//}}AFX_DATA_INIT<br />
}<br />
<br />
CMyPage1::~CMyPage1()<br />
{<br />
}<br />
<br />
void CMyPage1:oDataExchange(CDataExchange* pDX)<br />
{<br />
CPropertyPage:oDataExchange(pDX);<br />
//{{AFX_DATA_MAP(CMyPage1)<br />
DDX_Control(pDX, IDC_LIST_CTRL1, m_listctrl1);<br />
//}}AFX_DATA_MAP<br />
}<br />
<br />
<br />
BEGIN_MESSAGE_MAP(CMyPage1, CPropertyPage)<br />
//{{AFX_MSG_MAP(CMyPage1)<br />
ON_BN_CLICKED(IDC_BUTTON1, OnButton1)<br />
//}}AFX_MSG_MAP<br />
END_MESSAGE_MAP()<br />
<br />
/////////////////////////////////////////////////////////////////////////////<br />
// CMyPage1 message handlers<br />
<br />
BOOL CMyPage1::OnInitDialog() <br />
{<br />
CPropertyPage::OnInitDialog();<br />
return TRUE; <br />
}<br />
<br />
_________________________________________________________________<br />
<br />
// MyPage1.h : header file<br />
//<br />
/////////////////////////////////////////////////////////////////////////////<br />
// CMyPage1 dialog<br />
<br />
class CMyPage1 : public CPropertyPage<br />
{<br />
DECLARE_DYNCREATE(CMyPage1)<br />
<br />
// Construction<br />
public:<br />
CMyPage1();<br />
~CMyPage1();<br />
<br />
// Dialog Data<br />
//{{AFX_DATA(CMyPage1)<br />
enum { IDD = IDD_PAGE1 };<br />
CListCtrl m_listctrl1;<br />
//}}AFX_DATA<br />
<br />
<br />
// Overrides<br />
// ClassWizard generate virtual function overrides<br />
//{{AFX_VIRTUAL(CMyPage1)<br />
protected:<br />
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support<br />
//}}AFX_VIRTUAL<br />
<br />
// Implementation<br />
protected:<br />
// Generated message map functions<br />
//{{AFX_MSG(CMyPage1)<br />
virtual BOOL OnInitDialog();<br />
//}}AFX_MSG<br />
DECLARE_MESSAGE_MAP()<br />
<br />
};<br />
<br />
//{{AFX_INSERT_LOCATION}}

MyPage2 is identical to MyPage1
AnswerRe: How do I add text to a list control inside a property sheet? Pin
David Crow5-May-05 3:20
David Crow5-May-05 3:20 
GeneralResizing comboboxes Pin
Jörgen Sigvardsson4-May-05 9:33
Jörgen Sigvardsson4-May-05 9:33 
GeneralRe: Resizing comboboxes Pin
toxcct5-May-05 1:06
toxcct5-May-05 1:06 
GeneralRe: Resizing comboboxes Pin
Jörgen Sigvardsson5-May-05 1:10
Jörgen Sigvardsson5-May-05 1:10 
GeneralInterop::Excel::Hell Pin
Delver4-May-05 9:24
Delver4-May-05 9:24 
QuestionHow to detect video card type? (PCI/AGP/PCI-E) Pin
umgoblue5254-May-05 8:56
umgoblue5254-May-05 8:56 
GeneralLinking errors with MFC Dialog Based application and Crypto++ Pin
Crocodilek4-May-05 8:45
Crocodilek4-May-05 8:45 
GeneralRe: Linking errors with MFC Dialog Based application and Crypto++ Pin
Crocodilek5-May-05 19:18
Crocodilek5-May-05 19:18 
GeneralRe: Linking errors with MFC Dialog Based application and Crypto++ Pin
Crocodilek5-May-05 19:19
Crocodilek5-May-05 19:19 
Generalsdk Pin
_tasleem4-May-05 6:57
_tasleem4-May-05 6:57 
GeneralRe: sdk Pin
David Crow4-May-05 7:25
David Crow4-May-05 7:25 
GeneralRe: sdk Pin
_tasleem4-May-05 8:04
_tasleem4-May-05 8:04 
GeneralRe: sdk Pin
David Crow4-May-05 8:53
David Crow4-May-05 8:53 
Generalapi in vc Pin
4-May-05 6:27
suss4-May-05 6:27 
GeneralRe: api in vc Pin
Maximilien4-May-05 6:43
Maximilien4-May-05 6:43 
GeneralRe: api in vc Pin
4-May-05 7:07
suss4-May-05 7:07 
GeneralRe: api in vc Pin
Maximilien4-May-05 7:38
Maximilien4-May-05 7:38 

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.