I have asked this question on many C++ forms and no one has been answer my question and I dont know if it's to hard (which I doubt) or I am not explaining it correctly or what. So this time I am going to give every piece of info I can.

What I have a problem with is a pointer to a class. I have a FormView, SDI, MFC program. What I need is to be able to get the value from CString m_strTextOut. Maybe I am doing this wrong...Anyways

Here is my class:

Code:
#if !defined(AFX_NAPAWAYVIEW_H__6CAC2E48_F85C_46C0_B13D_138D65352F6C__INCLUDED_)
#define AFX_AWAYVIEW_H__6CAC2E48_F85C_46C0_B13D_138D65352F6C__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

class CAwayView : public CFormView
{
protected: // create from serialization only
	CAwayView();
	DECLARE_DYNCREATE(CAwayView)

public:
	//{{AFX_DATA(CAwayView)
	enum{ IDD = IDD_AWAY_FORM };
		// NOTE: the ClassWizard will add data members here
	//}}AFX_DATA

// Attributes
public:
	CAwayDoc* GetDocument();

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CNapAwayView)
	public:
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	virtual void OnInitialUpdate(); // called first time after construct
	//}}AFX_VIRTUAL

// Implementation
public:
	CString m_strTextOut;
	virtual ~CAwayView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// Generated message map functions
protected:
	//{{AFX_MSG(CNapAwayView)
	afx_msg void OnbtnEXIT();
	afx_msg void OnbtnCLEAR();
	afx_msg void OnbtnOK();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

#ifndef _DEBUG  // debug version in AwayView.cpp
inline CAwayDoc* CAwayView::GetDocument()
   { return (CAwayDoc*)m_pDocument; }
#endif

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_AWAYVIEW_H__6CAC2E48_F85C_46C0_B13D_138D65352F6C__INCLUDED_)
Now usually for any other class I would do (which I might be wrong):

CAwayView tmp;
CString strOut;
strOut = tmp.m_strTextOut;

But that does not work with this class because the constructor is private (I think). So after looking on the internet I found this:

CAwayView* pView = (CAwayView*)m_viewList.GetHead();
CString strOut;
strOut = pView->m_strTextOut;

Which worked fine for when I was saving the data but it does not work in any other class. Plus I have not idea what CAwayView* pView = (CAwayView*)m_viewList.GetHead(); does and it just looks wrong. I have tried everything I can think of but I cant make it work.

What I need is to be able to get the value from m_strTextOut.

Sorry this is so long but I need to get this to work, plus I am soooo frustrated.

Can anyone help???

Thanks