Click here to Skip to main content
16,007,111 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionDifference between MFC and windows form application Pin
frankis782-Dec-08 8:10
frankis782-Dec-08 8:10 
AnswerRe: Difference between MFC and windows form application Pin
toxcct2-Dec-08 8:29
toxcct2-Dec-08 8:29 
GeneralRe: Difference between MFC and windows form application Pin
frankis782-Dec-08 10:28
frankis782-Dec-08 10:28 
GeneralRe: Difference between MFC and windows form application Pin
Rajesh R Subramanian2-Dec-08 20:33
professionalRajesh R Subramanian2-Dec-08 20:33 
GeneralRe: Difference between MFC and windows form application Pin
frankis782-Dec-08 20:50
frankis782-Dec-08 20:50 
AnswerRe: Difference between MFC and windows form application PinPopular
led mike2-Dec-08 8:44
led mike2-Dec-08 8:44 
AnswerRe: Difference between MFC and windows form application Pin
Alan Balkany3-Dec-08 4:46
Alan Balkany3-Dec-08 4:46 
QuestionCompiler error C2440 when converting from VC++ 6.0 to VS .NET 2003 Pin
CarolLamoreaux2-Dec-08 8:02
CarolLamoreaux2-Dec-08 8:02 
I am getting the following error in .NET after converting my project from VC++ 6.0:
d:\utilities\FlightReport\FlightReport\FlightReportDoc.cpp(31): error C2440: 'static_cast' : cannot convert from 'BOOL (__thiscall CFlightReportDoc::* )(void)' to 'AFX_PMSG'

Can anyone help with this error and how to fix it? I did not get this error in VC++ 6.0!

Here is the code causing the error:
// FlightReportDoc.h : interface of the CFlightReportDoc class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_FLIGHTREPORTDOC_H__3EF623EF_987A_11D4_8093_00B0D0200BF9__INCLUDED_)
#define AFX_FLIGHTREPORTDOC_H__3EF623EF_987A_11D4_8093_00B0D0200BF9__INCLUDED_

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

#include "StatNode.h"
#include "ReportParameters.h"

class CFlightReportDoc : public CDocument
{
protected: // create from serialization only
	CFlightReportDoc();
	DECLARE_DYNCREATE(CFlightReportDoc)

// Attributes
public:

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CFlightReportDoc)
	public:
	virtual BOOL OnNewDocument();
	virtual void Serialize(CArchive& ar);
	//}}AFX_VIRTUAL

// Implementation
public:
	virtual ~CFlightReportDoc();

	CString m_saved_filename;
	CString m_html_file;
	CString m_current_path;
	CString m_temp_report;
	CStringList* m_model_list;
	CStatNode* m_stat_node;
	CString m_model_directory;
	static CReportParameters* m_report_parameters;

	CString GetFilenameWithoutPath(CString filename);
	CString GetBaseName(CString model_name);
	void CloseHTMLFile(CStdioFile &OutFile);
	void WriteHTMLFile(CStdioFile &OutFile);
	void InitStandardReportFile(CStdioFile &OutFile, CString m_version, bool view_only);
	void InitAbbreviatedReportFile(CStdioFile &OutFile, CString m_catalog_full_pages, CString m_version);

#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// Generated message map functions
protected:
	//{{AFX_MSG(CFlightReportDoc)
	afx_msg void OnFileOpen();
	afx_msg void OnFileSaveAs();
	afx_msg void OnFileSave();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
public:
	void DeleteContents(void);
};

/////////////////////////////////////////////////////////////////////////////

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

#endif // !defined(AFX_FLIGHTREPORTDOC_H__3EF623EF_987A_11D4_8093_00B0D0200BF9__INCLUDED_)



// FlightReportDoc.cpp : implementation of the CFlightReportDoc class
//

#include "stdafx.h"
#include "FlightReport.h"
#include "FlightReportDoc.h"
#include "StatNode.h"
#include "DescriptionList.h"
#include "FileProgress.h"
#include "SelectFilesDialog.h"
#include "RunSilent.h"
#include <cderr.h>

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

static int counter = 0;
/////////////////////////////////////////////////////////////////////////////
// CFlightReportDoc

IMPLEMENT_DYNCREATE(CFlightReportDoc, CDocument)

BEGIN_MESSAGE_MAP(CFlightReportDoc, CDocument)
	//{{AFX_MSG_MAP(CFlightReportDoc)
	ON_COMMAND(ID_FILE_OPEN, OnFileOpen)
	ON_COMMAND(ID_FILE_SAVE_AS, OnFileSaveAs)
	ON_COMMAND(ID_FILE_SAVE, OnFileSave)
	ON_COMMAND(ID_FILE_NEW, OnNewDocument)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CFlightReportDoc construction/destruction

CReportParameters* CFlightReportDoc::m_report_parameters = new CReportParameters();

CFlightReportDoc::CFlightReportDoc()
{
	m_stat_node = new CStatNode();
	m_model_list = new CStringList();
	m_saved_filename.Empty();
	m_current_path.Empty();

	// try to set path for temporary _report file to TEMP or TMP
	// environment variable -- if not defined, use C:
	m_current_path = getenv( "TEMP" );
	if( m_current_path.IsEmpty() )
		m_current_path = getenv( "TMP" );
	if( m_current_path.IsEmpty() )
		m_current_path = "C:";

	srand((unsigned)time(0)); 
	m_temp_report.Format("%s\\_report_%i.htm", m_current_path, rand());
}

CFlightReportDoc::~CFlightReportDoc()
{

	delete m_stat_node;
	delete m_model_list;

	sprintf(cmd, "");
	sprintf(args, "del /Q \"%s\"", m_temp_report);
	RunSilent(cmd, args);
	CWaitCursor wc;
}

BOOL CFlightReportDoc::OnNewDocument()
{
	//DeleteContents() is now called - this deletes the document's contents and navigates to a blank screen.....	

	if (!CDocument::OnNewDocument())
		return FALSE;
	
	delete m_stat_node;
	m_stat_node = new CStatNode();
	delete m_model_list;
	m_model_list = new CStringList();
	m_saved_filename.Empty();
	m_model_directory.Empty();

	delete m_report_parameters;
	m_report_parameters = new CReportParameters();

	//defaults
	m_report_parameters->m_write_reset_files = false;
	m_report_parameters->m_rst_ms_num = 3;
	m_report_parameters->m_rst_slot_num = 10;

	m_report_parameters->m_write_mht = false;
	m_report_parameters->m_rt_shadow_sw = 20;
	m_report_parameters->m_ref_folders = false;
	m_report_parameters->m_disable_versioning = false;

	// get installation directory from the registry
	CWinApp* pApp = AfxGetApp();
	// following line is for testing only -- reg key added by installer
	//	pApp->WriteProfileString(_T("Dir"), _T(""), "C:\\EaS\\utility" );
	m_report_parameters->m_install_dir = pApp->GetProfileString(_T(""), _T("Dir") );

	return TRUE;
}


/////////////////////////////////////////////////////////////////////////////
// CFlightReportDoc serialization

void CFlightReportDoc::Serialize(CArchive& ar)
{
	if (ar.IsStoring())
	{
		// TODO: add storing code here
	}
	else
	{
		// TODO: add loading code here
	}
}

/////////////////////////////////////////////////////////////////////////////
// CFlightReportDoc diagnostics

#ifdef _DEBUG
void CFlightReportDoc::AssertValid() const
{
	CDocument::AssertValid();
}

void CFlightReportDoc::Dump(CDumpContext& dc) const
{
	CDocument::Dump(dc);
}
#endif //_DEBUG

AnswerRe: Compiler error C2440 when converting from VC++ 6.0 to VS .NET 2003 Pin
Stuart Dootson2-Dec-08 8:30
professionalStuart Dootson2-Dec-08 8:30 
GeneralRe: Compiler error C2440 when converting from VC++ 6.0 to VS .NET 2003 [modified] Pin
CarolLamoreaux2-Dec-08 8:48
CarolLamoreaux2-Dec-08 8:48 
GeneralRe: Compiler error C2440 when converting from VC++ 6.0 to VS .NET 2003 Pin
Stuart Dootson2-Dec-08 20:53
professionalStuart Dootson2-Dec-08 20:53 
Questiontext wrapping for a custom ctreectrl (mfc) Pin
kitkat120122-Dec-08 8:01
kitkat120122-Dec-08 8:01 
AnswerRe: text wrapping for a custom ctreectrl (mfc) Pin
Code-o-mat2-Dec-08 8:09
Code-o-mat2-Dec-08 8:09 
GeneralRe: text wrapping for a custom ctreectrl (mfc) Pin
kitkat120122-Dec-08 8:30
kitkat120122-Dec-08 8:30 
GeneralRe: text wrapping for a custom ctreectrl (mfc) Pin
Code-o-mat2-Dec-08 8:55
Code-o-mat2-Dec-08 8:55 
GeneralRe: text wrapping for a custom ctreectrl (mfc) Pin
kitkat120122-Dec-08 10:51
kitkat120122-Dec-08 10:51 
QuestionRe: text wrapping for a custom ctreectrl (mfc) Pin
Singh, Yashpal10-Dec-13 20:17
Singh, Yashpal10-Dec-13 20:17 
QuestionPlease consider the following C Program Pin
BobInNJ2-Dec-08 7:42
BobInNJ2-Dec-08 7:42 
AnswerRe: Please consider the following C Program Pin
toxcct2-Dec-08 7:51
toxcct2-Dec-08 7:51 
AnswerRe: Please consider the following C Program Pin
Code-o-mat2-Dec-08 7:55
Code-o-mat2-Dec-08 7:55 
GeneralRe: Please consider the following C Program Pin
toxcct2-Dec-08 8:05
toxcct2-Dec-08 8:05 
GeneralRe: Please consider the following C Program Pin
Code-o-mat2-Dec-08 8:17
Code-o-mat2-Dec-08 8:17 
GeneralRe: Please consider the following C Program Pin
toxcct2-Dec-08 8:19
toxcct2-Dec-08 8:19 
GeneralRe: Please consider the following C Program Pin
CPallini2-Dec-08 9:22
mveCPallini2-Dec-08 9:22 
GeneralRe: Please consider the following C Program Pin
toxcct2-Dec-08 9:25
toxcct2-Dec-08 9:25 

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.