WM_INITDIALOG

Intrebari legate de programarea cu biblioteci precum MFC, ATL, WTL si GDI+.
Post Reply
viorel2004ro
Membru
Membru
Posts: 67
Joined: 20 Mar 2008, 23:23

WM_INITDIALOG

Post by viorel2004ro » 18 May 2008, 11:42

Salut

1.De ce in VC++ 6 se permitea tratarea acestui mesaj si in VC++ 2008 nu?
2.Ce alternativa asemanatoarea am in cazul in care scoaterea a fost justificata?
3.Exista vreun add-on care imi permite tratarea acestui mesaj in Visual c++ , decat sa il introduc
manual?



User avatar
Ovidiu Cucu
Fondator
Fondator
Posts: 3778
Joined: 11 Jul 2007, 16:10
Judet: Iaşi
Location: Iasi
Contact:

Re: WM_INITDIALOG

Post by Ovidiu Cucu » 18 May 2008, 11:55

Cin'ti-a spus ca 2008-ul nu permite tratarea mesajului WM_INITDIALOG ?
Ia cauta prin lista de proprietati a clasei tale derivate din CDialog ceva care se numeste OnInitDialog apoi trage un ochi in MSDN la CDialog::OnInitDialog !
Se fapt chestia putin confuza era in VS6.0 unde ClassWizard-ul iti arata in lista WM_INITDIALOG dar iti punea in cod functia virtuala OnInitDialog. In fond si la urma urmei, rezultatul e acelasi.

viorel2004ro
Membru
Membru
Posts: 67
Joined: 20 Mar 2008, 23:23

Re: WM_INITDIALOG

Post by viorel2004ro » 18 May 2008, 12:19

clasa e derivata din CDialogEx

Code: Select all

#pragma once
#include "afxwin.h"
#include "SistMuncaSet.h"
#include "FactRiscSet.h"
#include "RiscManifestSet.h"
// CFactRiscDlg dialog

class CFactRiscDlg : public CDialogEx
{
	DECLARE_DYNAMIC(CFactRiscDlg)

public:
	CFactRiscDlg(CWnd* pParent = NULL);   // standard constructor
	virtual ~CFactRiscDlg();

// Dialog Data
	enum { IDD = IDD_FACTRISCDLG };

protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support

	DECLARE_MESSAGE_MAP()
public:
	afx_msg void OnBnClickedFirst();
	afx_msg void OnBnClickedPrev();
	afx_msg void OnBnClickedNext();
	afx_msg void OnBnClickedLast();
	afx_msg void OnBnClickedAdd();
	afx_msg void OnBnClickedEdit();
	afx_msg void OnBnClickedDelete();
	afx_msg void OnBnClickedUpdate();
	afx_msg void OnCbnSelchangeIds();
	afx_msg void OnCbnSelchangeIdf();
public:
	CComboBox m_Ids;
	CComboBox m_Idf;
	CString m_componenta;
	CString m_fact_risc;
	CString m_descriere;
private:
	CSistMuncaSet m_SistMuncaSet;
	CFactRiscSet m_FactRiscSet;
	CRiscManifestSet m_RiscManifestSet;
	int nOpt;
private:
	
};

Code: Select all

// FactRiscDlg.cpp : implementation file
//

#include "stdafx.h"
#include "RiscEval.h"
#include "FactRiscDlg.h"


// CFactRiscDlg dialog

IMPLEMENT_DYNAMIC(CFactRiscDlg, CDialogEx)

CFactRiscDlg::CFactRiscDlg(CWnd* pParent /*=NULL*/)
	: CDialogEx(CFactRiscDlg::IDD, pParent)
	, m_componenta(_T(""))
	, m_fact_risc(_T(""))
	, m_descriere(_T(""))
{

}

CFactRiscDlg::~CFactRiscDlg()
{
}

void CFactRiscDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialogEx::DoDataExchange(pDX);
	DDX_Control(pDX, IDC_IDS, m_Ids);
	DDX_Control(pDX, IDC_IDF, m_Idf);
	DDX_Text(pDX, IDC_COMPONENTA, m_componenta);
	DDX_Text(pDX, IDC_FACT_RISC, m_fact_risc);
	DDX_Text(pDX, IDC_DESCRIERE, m_descriere);
}


BEGIN_MESSAGE_MAP(CFactRiscDlg, CDialogEx)
	ON_BN_CLICKED(IDC_FIRST, &CFactRiscDlg::OnBnClickedFirst)
	ON_BN_CLICKED(IDC_PREV, &CFactRiscDlg::OnBnClickedPrev)
	ON_BN_CLICKED(IDC_NEXT, &CFactRiscDlg::OnBnClickedNext)
	ON_BN_CLICKED(IDC_LAST, &CFactRiscDlg::OnBnClickedLast)
	ON_BN_CLICKED(IDC_ADD, &CFactRiscDlg::OnBnClickedAdd)
	ON_BN_CLICKED(IDC_EDIT, &CFactRiscDlg::OnBnClickedEdit)
	ON_BN_CLICKED(IDC_DELETE, &CFactRiscDlg::OnBnClickedDelete)
	ON_BN_CLICKED(IDC_UPDATE, &CFactRiscDlg::OnBnClickedUpdate)
	ON_CBN_SELCHANGE(IDC_IDS, &CFactRiscDlg::OnCbnSelchangeIds)
	ON_CBN_SELCHANGE(IDC_IDF, &CFactRiscDlg::OnCbnSelchangeIdf)
END_MESSAGE_MAP()


// CFactRiscDlg message handlers

void CFactRiscDlg::OnBnClickedFirst()
{
	// TODO: Add your control notification handler code here
	nOpt=0;
}

void CFactRiscDlg::OnBnClickedPrev()
{
	// TODO: Add your control notification handler code here
	nOpt=0;
}

void CFactRiscDlg::OnBnClickedNext()
{
	// TODO: Add your control notification handler code here
	nOpt=0;
}

void CFactRiscDlg::OnBnClickedLast()
{
	// TODO: Add your control notification handler code here
	nOpt=0;
}

void CFactRiscDlg::OnBnClickedAdd()
{
	// TODO: Add your control notification handler code here
	nOpt=1;
}

void CFactRiscDlg::OnBnClickedEdit()
{
	// TODO: Add your control notification handler code here
	nOpt=2;
}

void CFactRiscDlg::OnBnClickedDelete()
{
	// TODO: Add your control notification handler code here
	nOpt=3;
}

void CFactRiscDlg::OnBnClickedUpdate()
{
	// TODO: Add your control notification handler code here
	switch(nOpt)
	{
	case 0:
			break;
		 1:
			break;
		 2:	
			break;
		 3:
			break;

	}
}

void CFactRiscDlg::OnCbnSelchangeIds()
{
	// TODO: Add your control notification handler code here
}

void CFactRiscDlg::OnCbnSelchangeIdf()
{
	// TODO: Add your control notification handler code here
}
deci trebuie adaugata manual?Am atasat si poza ca la proprietati nu apare nimic..Sau e vb de alta fereastra?
Attachments
1.rar
poza atasata
(4.87 KiB) Downloaded 241 times

neagu_laurentiu
Membru++
Membru++
Posts: 919
Joined: 23 Jul 2007, 11:32

Re: WM_INITDIALOG

Post by neagu_laurentiu » 18 May 2008, 12:34

deci trebuie adaugata manual?Am atasat si poza ca la proprietati nu apare nimic
Se poate si manual dar merge si automat. Daca esti in .h-ul dialog-ului ai la Properties si Overrides iar aici poti suprascrie direct OnInitDialog (cel putin de la VC++ Professional in sus).

viorel2004ro
Membru
Membru
Posts: 67
Joined: 20 Mar 2008, 23:23

Re: WM_INITDIALOG

Post by viorel2004ro » 18 May 2008, 12:42

Multumesc.Am gasit acum.Dar cam ascunsa optiunea.

User avatar
Ovidiu Cucu
Fondator
Fondator
Posts: 3778
Joined: 11 Jul 2007, 16:10
Judet: Iaşi
Location: Iasi
Contact:

Re: WM_INITDIALOG

Post by Ovidiu Cucu » 18 May 2008, 12:45

Nu-i chiar asa ascunsa, tre sa stii unde sa cauti.
Oricum iti dau dreptate.... si eu urasc acele "property lists" VB-like care au inlocuit ClassWizard-ul. ;)

Post Reply