je souhaite integrer une combo box dans ma property page. Je souhaite l'iniatialiser avec une liste de valeurs possible pour une propriété via OnInitDialog() mais quand je souhaite voir mes pages de propriété dans visual Basic ou VC++ il y a un debug assert. coment faire pour régler ce problème? Bien évidement la liste des elements de la combobox ne sont pas statiques ils dépendent de renseignements situés dans la base des regestres (cette fonctions fonctionne parfaitement)
merci de votre aide. voic le code de OnInitdialog() et de la page de propriétés
// BabilAXPpg.cpp : Implementation of the CBabilAXPropPage property page class.
#include "stdafx.h"
#include "BabilAX.h"
#include "BabilAXPpg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
IMPLEMENT_DYNCREATE(CBabilAXPropPage, COlePropertyPage)
/////////////////////////////////////////////////////////////////////////////
// Message map
BEGIN_MESSAGE_MAP(CBabilAXPropPage, COlePropertyPage)
//{{AFX_MSG_MAP(CBabilAXPropPage)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// Initialize class factory and guid
IMPLEMENT_OLECREATE_EX(CBabilAXPropPage, "BABILAX.BabilAXPropPage.1",
0xf12b3fe8, 0xcf8e, 0x4520, 0xba, 0x88, 0x26, 0x61, 0xbd, 0x76, 0xbe, 0xfd)
/////////////////////////////////////////////////////////////////////////////
// CBabilAXPropPage::CBabilAXPropPageFactory::UpdateRegistry -
// Adds or removes system registry entries for CBabilAXPropPage
BOOL CBabilAXPropPage::CBabilAXPropPageFactory::UpdateRegistry(BOOL bRegister)
{
if (bRegister)
return AfxOleRegisterPropertyPageClass(AfxGetInstanceHandle(),
m_clsid, IDS_BABILAX_PPG);
else
return AfxOleUnregisterClass(m_clsid, NULL);
}
/////////////////////////////////////////////////////////////////////////////
// CBabilAXPropPage::CBabilAXPropPage - Constructor
CBabilAXPropPage::CBabilAXPropPage() :
COlePropertyPage(IDD, IDS_BABILAX_PPG_CAPTION)
{
//{{AFX_DATA_INIT(CBabilAXPropPage)
m_Speed = 0;
m_Frequency = 0;
m_Language = _T("");
m_Pitch = 0;
m_PitchMax = 0;
m_PitchMin = 0;
m_Sync = FALSE;
m_Volume = 0;
m_SpeechFont = _T("");
//}}AFX_DATA_INIT
SetHelpInfo(_T("Names to appear in the control"), _T("BABILAX.HLP"), 0);
}
/////////////////////////////////////////////////////////////////////////////
// CBabilAXPropPage::DoDataExchange - Moves data between page and properties
void CBabilAXPropPage::DoDataExchange(CDataExchange* pDX)
{
//{{AFX_DATA_MAP(CBabilAXPropPage)
DDX_Control(pDX, IDC_SPEECHFONT, m_SpeechFontComboBox);
DDP_Text(pDX, IDC_SPEED, m_Speed, _T("Speed") );
DDX_Text(pDX, IDC_SPEED, m_Speed);
DDP_Text(pDX, IDC_FREQUENCY, m_Frequency, _T("Frequency") );
DDX_Text(pDX, IDC_FREQUENCY, m_Frequency);
DDP_Text(pDX, IDC_LANGUAGE, m_Language, _T("Language") );
DDX_Text(pDX, IDC_LANGUAGE, m_Language);
DDP_Text(pDX, IDC_PITCH, m_Pitch, _T("Pitch") );
DDX_Text(pDX, IDC_PITCH, m_Pitch);
DDP_Text(pDX, IDC_PITCHMAX, m_PitchMax, _T("PitchMAx") );
DDX_Text(pDX, IDC_PITCHMAX, m_PitchMax);
DDP_Text(pDX, IDC_PITCHMIN, m_PitchMin, _T("PitchMin") );
DDX_Text(pDX, IDC_PITCHMIN, m_PitchMin);
DDP_Check(pDX, IDC_SYNC, m_Sync, _T("Sync") );
DDX_Check(pDX, IDC_SYNC, m_Sync);
DDP_Text(pDX, IDC_VOLUME, m_Volume, _T("Volume") );
DDX_Text(pDX, IDC_VOLUME, m_Volume);
DDV_MinMaxLong(pDX, m_Volume, 0, 100);
DDP_CBString(pDX, IDC_SPEECHFONT, m_SpeechFont, _T("SpeechFont") );
DDX_CBString(pDX, IDC_SPEECHFONT, m_SpeechFont);
//}}AFX_DATA_MAP
DDP_PostProcessing(pDX);
}
BOOL CBabilAXPropPage::OnInitDialog()
{
COlePropertyPage::OnInitDialog();
// TODO: Add extra initialization here
CString SpeechFont;
SpeechFont = "test";
m_SpeechFontComboBox.AddString (SpeechFont );
return FALSE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}