Bonjour a tous.
J'ai encore quelques soucis avec des valeures numériques.
Mon application effectue des calculs, qui se passent a merveille tant que les valeurs sont entieres.
Cependant des que l'une d'entre elle devient decimale, j'obtien 0 pour k et a forciori pour l.
Pourtant la varialbe qui prend la valeur est declarée en float.
Si vous voyez d'ou ca peut venir dites moi.
Voila le code en question, enfin les codes puisque cela ce produit pour 2 calculs différent.
Merci.
T.
float y;
float p;
float l;
float lo;
long double k;
float g;
char buf[256];
Premier calcul ou l'erreur se produit
case IDC_ASSUM1:
lo=GetDlgItemInt(hWndlength,EDITLOADING,NULL,TRUE);
y=GetDlgItemInt(hWndlength,EDITYOUNG,NULL,TRUE);
p=GetDlgItemInt(hWndlength,EDITPOISSON,NULL,TRUE);
g=GetDlgItemInt(hWndlength,EDITGIC,NULL,TRUE);
k=(g*1000)*((4*y*1000000)/(3-p));
l=(k*k)/(lo*1000000*lo*1000000*Pi);
sprintf(buf,"%le",k);
SetDlgItemText(hWndlength,EDITLENGTHCRACK,buf);
DialogBoxParam(hInstlength,MAKEINTRESOURCE(IDD_ASSUM1),hWndlength,ChildDlgProc,NULL);
Deuxieme calcul ou l'erreur se produit
lo=GetDlgItemInt(hWndlength,EDITLOADING,NULL,TRUE);
y=GetDlgItemInt(hWndlength,EDITYOUNG,NULL,TRUE);
p=GetDlgItemInt(hWndlength,EDITPOISSON,NULL,TRUE);
g=GetDlgItemInt(hWndlength,EDITGIC,NULL,TRUE);
k=g*1000/((3-p)/(4*y*1000000));
l=(k*k)/(1.4884*lo*1000000*lo*1000000*Pi);
sprintf(buf,"%le",l);
SetDlgItemText(hWndlength,EDITLENGTHCRACK,buf);
DialogBoxParam(hInstlength,MAKEINTRESOURCE(IDD_ASSUM3),hWndlength,ChildDlgProc,NULL);
J'ai aussi un probleme avec le lancement des dialogBox IDD_ASSUM1 et IDD_ASSUM3. Dans l'editeur de ressources, elles contiennent une zone image avec un bitmap qui s'affiche, mais quand je demande l'affichage sur clique d'un boutton radio, la DialogBox se lance mais l'image n'apparait pas.
En vous remerciant pour votre aide.
T.