Click here to Skip to main content

C / C++ / MFC

   

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page  Show 
  Refresh
AnswerRe: Difference between MFC and windows form application Pinmvptoxcct8:29 2 Dec '08  
GeneralRe: Difference between MFC and windows form application Pinmemberfrankis7810:28 2 Dec '08  
GeneralRe: Difference between MFC and windows form application PinmvpRajesh R Subramanian20:33 2 Dec '08  
GeneralRe: Difference between MFC and windows form application Pinmemberfrankis7820:50 2 Dec '08  
AnswerRe: Difference between MFC and windows form application Pinmvpled mike8:44 2 Dec '08  
AnswerRe: Difference between MFC and windows form application PinmemberAlan Balkany4:46 3 Dec '08  
QuestionCompiler error C2440 when converting from VC++ 6.0 to VS .NET 2003 PinmemberCarolLamoreaux8:02 2 Dec '08  
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 PinmemberStuart Dootson8:30 2 Dec '08  
GeneralRe: Compiler error C2440 when converting from VC++ 6.0 to VS .NET 2003 [modified] PinmemberCarolLamoreaux8:48 2 Dec '08  
GeneralRe: Compiler error C2440 when converting from VC++ 6.0 to VS .NET 2003 PinmemberStuart Dootson20:53 2 Dec '08  
Questiontext wrapping for a custom ctreectrl (mfc) Pinmemberkitkat120128:01 2 Dec '08  
AnswerRe: text wrapping for a custom ctreectrl (mfc) PinmemberCode-o-mat8:09 2 Dec '08  
GeneralRe: text wrapping for a custom ctreectrl (mfc) Pinmemberkitkat120128:30 2 Dec '08  
GeneralRe: text wrapping for a custom ctreectrl (mfc) PinmemberCode-o-mat8:55 2 Dec '08  
GeneralRe: text wrapping for a custom ctreectrl (mfc) Pinmemberkitkat1201210:51 2 Dec '08  
QuestionPlease consider the following C Program PinmemberBobInNJ7:42 2 Dec '08  
AnswerRe: Please consider the following C Program Pinmvptoxcct7:51 2 Dec '08  
AnswerRe: Please consider the following C Program PinmemberCode-o-mat7:55 2 Dec '08  
GeneralRe: Please consider the following C Program Pinmvptoxcct8:05 2 Dec '08  
GeneralRe: Please consider the following C Program PinmemberCode-o-mat8:17 2 Dec '08  
GeneralRe: Please consider the following C Program Pinmvptoxcct8:19 2 Dec '08  
GeneralRe: Please consider the following C Program PinmvpCPallini9:22 2 Dec '08  
GeneralRe: Please consider the following C Program Pinmvptoxcct9:25 2 Dec '08  
GeneralRe: Please consider the following C Program PinmvpCPallini9:29 2 Dec '08  
AnswerRe: Please consider the following C Program PinmvpDavidCrow8:04 2 Dec '08  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web03 | 2.5.120604.1 | Last Updated 4 Jun 2012
Copyright © CodeProject, 1999-2012
All Rights Reserved. Terms of Use
Layout: fixed | fluid