IdentifiantMot de passe
Loading...
Mot de passe oubli� ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les r�ponses en temps r�el, voter pour les messages, poser vos propres questions et recevoir la newsletter

MFC Discussion :

[MFC] probl�me de r�cup�ration des edit en float


Sujet :

MFC

  1. #1
    Membre averti
    Profil pro
    Inscrit en
    Septembre 2005
    Messages
    21
    D�tails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2005
    Messages : 21
    Par d�faut [MFC] probl�me de r�cup�ration des edit en float
    Boujour, dans l'une de mes boite de dialogue j'ai des edit en float, je met des chiffre dedant puis j'enregistre le fichier, et quand je veux ouvrir ce fichier, les edit en float reste a l'�tat initiale que je lui ai fixer, c'est � dire 0, donc ne reprend pas les chiffre que j'ai entr� puis enregistrer alors que les edit en CString sont pris correctement.
    avez vous une solution a m'indiquer enfin si vous comprenez ce que je veux dire.

  2. #2
    R�dacteur
    Avatar de nico-pyright(c)
    Profil pro
    Inscrit en
    Octobre 2003
    Messages
    6 414
    D�tails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2003
    Messages : 6 414
    Par d�faut
    salut,

    tu enregistres comment ? tu lis comment ? tu affectes tes variables comment ? tu fais la mise � jour des controles comment ?

  3. #3
    Membre averti
    Profil pro
    Inscrit en
    Septembre 2005
    Messages
    21
    D�tails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2005
    Messages : 21
    Par d�faut
    Dans CSampleView.cpp :
    Code : S�lectionner tout - Visualiser dans une fen�tre � part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    void CSampleView::OnInitialUpdate()
    {
    	CFormView::OnInitialUpdate();
    	GetParentFrame()->RecalcLayout();
    	ResizeParentToFit();
    	TRACE("Mainframe:%X view:%X",AfxGetMainWnd()->GetSafeHwnd(),this->GetSafeHwnd());
    	m_Prix1=m_Prix2=m_Prix3=m_Prix4=m_Prix5=m_Prix6=m_Prix7=m_Total=0;
    	UpdateData(FALSE);
    	m_Raz.EnableWindow(FALSE);
    }
    void CSampleView::Serialize(CArchive& ar)
    {
        if (ar.IsStoring())
        {        
    ar<<m_Nomc<<m_Prenom<<m_Adresse<<m_Adresse2<<m_CP<<m_Ville<<m_Telf<<m_Telp<<m_Rem;
    ...
    ar<<m_Prix1<<m_Prix2<<m_Prix3<<m_Prix4<<m_Prix5<<m_Prix6<<m_Prix7<<m_Total;
        }
        else
        {
    ar>>m_Nomc>>m_Prenom>>m_Adresse>>m_Adresse2>>m_CP>>m_Ville>>m_Telf>>m_Telp>>m_Rem;
    ...
    ar>>m_Prix1>>m_Prix2>>m_Prix3>>m_Prix4>>m_Prix5>>m_Prix6>>m_Prix7>>m_Total;
        }
    }
    void CSampleView::OnButtonFact() 
    {
    	// TODO: Add your control notification handler code here
    	Dialog Dlg;
    	Dlg.m_Prix1=m_Prix1;
    	Dlg.m_Prix2=m_Prix2;
    	Dlg.m_Prix3=m_Prix3;
    	Dlg.m_Prix4=m_Prix4;
    	Dlg.m_Prix5=m_Prix5;
    	Dlg.m_Prix6=m_Prix6;
    	Dlg.m_Prix7=m_Prix7;
    	Dlg.m_Total=m_Total;
    	if(Dlg.DoModal()==IDOK)
    	{
    #ifdef _DEBUG
    		afxDump << "Prix1" << Dlg.m_Prix1 <<"\n";
    		afxDump << "Prix2" << Dlg.m_Prix2 <<"\n";
    		afxDump << "Prix3" << Dlg.m_Prix3 <<"\n";
    		afxDump << "Prix4" << Dlg.m_Prix4 <<"\n";
    		afxDump << "Prix5" << Dlg.m_Prix5 <<"\n";
    		afxDump << "Prix6" << Dlg.m_Prix6 <<"\n";
    		afxDump << "Prix7" << Dlg.m_Prix7 <<"\n";
    		afxDump << "Total" << Dlg.m_Total <<"\n";
    #endif
    	m_Prix1=Dlg.m_Prix1;
    	m_Prix2=Dlg.m_Prix2;
    	m_Prix3=Dlg.m_Prix3;
    	m_Prix4=Dlg.m_Prix4;
    	m_Prix5=Dlg.m_Prix5;
    	m_Prix6=Dlg.m_Prix6;
    	m_Prix7=Dlg.m_Prix7;
    	m_Total=Dlg.m_Total;
    	}
    }
    Dans SampleDoc.cpp :
    Code : S�lectionner tout - Visualiser dans une fen�tre � part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    void CSampleDoc::Serialize(CArchive& ar)
    {
    	if (ar.IsStoring())
    	{
    		// TODO: add storing code here
    	}
    	else
    	{
    		// TODO: add loading code here
    	}
    	POSITION pos = GetFirstViewPosition();   
        CSalondeToilettageView* pView = static_cast<CSalondeToilettageView *>(GetNextView(pos));
        pView->Serialize(ar);
    }
    Dans Fact.cpp :
    Code : S�lectionner tout - Visualiser dans une fen�tre � part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    BOOL CFact::OnInitDialog() 
    {
    	CDialog::OnInitDialog();
    	// TODO: Add extra initialization here
    	return TRUE;  // return TRUE unless you set the focus to a control
    	              // EXCEPTION: OCX Property Pages should return FALSE
    }
    void CFact::OnOK() 
    {
    	// TODO: Add extra validation here
    	UpdateData(TRUE);
    	CDialog::OnOK();
    }

  4. #4
    Membre averti
    Profil pro
    Inscrit en
    Septembre 2005
    Messages
    21
    D�tails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2005
    Messages : 21
    Par d�faut
    J'ai trouv� se qui clochait fallait enlever
    Code : S�lectionner tout - Visualiser dans une fen�tre � part
    m_Prix1=m_Prix2=m_Prix3=m_Prix4=m_Prix5=m_Prix6=m_Prix7=m_Total=0;
    dans SampleView.cpp

+ R�pondre � la discussion
Cette discussion est r�solue.

Discussions similaires

  1. R�ponses: 31
    Dernier message: 27/07/2006, 13h51
  2. R�ponses: 22
    Dernier message: 05/07/2006, 15h21
  3. [SQL] Probl�me de r�cup�ration des valeurs d'une liste multiple en php
    Par BOLARD dans le forum PHP & Base de donn�es
    R�ponses: 1
    Dernier message: 01/05/2006, 00h29
  4. R�ponses: 2
    Dernier message: 31/03/2006, 09h23
  5. R�ponses: 8
    Dernier message: 12/05/2005, 08h16

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo