polo
July 30th, 1999, 05:53 AM
Hi,
I basically have the following problem
once this drawing method is called
void Graphe::Signal(CDC* pDC, long largeur_totale, int nb_pixel_trame,
int taille_trame)
{
CPen* pOldPen;
//modifie les coordonnees du graphe.
float largeur_affichage=(float)((float)largeur_totale-((float)Origine().x));
Fin_absisse(CPoint((int)largeur_affichage, Fin_absisse().y) );
//dessin de la regle
CPen RulerPen(PS_SOLID, 1, RGB(0,255,0) );//vert
pOldPen = pDC->SelectObject(&RulerPen);
pDC->MoveTo(Origine().x,Fin_ordonnee().y+10);
pDC->LineTo((int)largeur_affichage-10,Fin_ordonnee().y+10);
int taille_graduation = (int)(largeur_affichage/(float)Nb_graduations(ABSISSE));
for(int j = 0; j< Nb_graduations(ABSISSE); j++){
pDC->MoveTo(Origine().x+taille_graduation*j, Fin_ordonnee().y+10);
pDC->LineTo(Origine().x+taille_graduation*j, Fin_ordonnee().y+3);
}
//les unites
CFont font;
font.CreateFont(-10,0,0,0,FW_NORMAL,FALSE,FALSE,0,ANSI_CHARSET,OUT_DEVICE_PRECIS,
CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_SWISS, "Arial");
CFont* pOldFont = (CFont*) pDC->SelectObject(&font);
float duree_graduation =(float) taille_graduation / (float)nb_pixel_trame * (float)taille_trame;
CString str_unite;
str_unite.Format("Une graduation = %0.1f ms",duree_graduation);
pDC->TextOut(graphe_signal.Origine().x,
graphe_signal.Fin_ordonnee().y+10,str_unite);
//redessine le trait de base de la regle
pOldPen = pDC->SelectObject(&RulerPen);
pDC->MoveTo(graphe_signal.Origine().x,
graphe_signal.Fin_ordonnee().y+10);
pDC->LineTo((int)largeur_affichage-10,graphe_signal.Fin_ordonnee().y+10);
}
the fact of playing playing with the horizontal scoll bar just causes the whole app to crash
I get messages in the debug window like
Warning: Uncaught exception in WindowProc (returning 0).
First-chance exception in gds.exe (MSVCRTD.DLL): 0xE06D7363: Microsoft C++ Exception.
Any ideas are welcome,
thanks
###
#####
#######
#####
\\\|/// ###
| ~ ~ | #
(- * * -) #
------------oOOo-(_)-oO#o-----------
| #
^ #
" #
##
I basically have the following problem
once this drawing method is called
void Graphe::Signal(CDC* pDC, long largeur_totale, int nb_pixel_trame,
int taille_trame)
{
CPen* pOldPen;
//modifie les coordonnees du graphe.
float largeur_affichage=(float)((float)largeur_totale-((float)Origine().x));
Fin_absisse(CPoint((int)largeur_affichage, Fin_absisse().y) );
//dessin de la regle
CPen RulerPen(PS_SOLID, 1, RGB(0,255,0) );//vert
pOldPen = pDC->SelectObject(&RulerPen);
pDC->MoveTo(Origine().x,Fin_ordonnee().y+10);
pDC->LineTo((int)largeur_affichage-10,Fin_ordonnee().y+10);
int taille_graduation = (int)(largeur_affichage/(float)Nb_graduations(ABSISSE));
for(int j = 0; j< Nb_graduations(ABSISSE); j++){
pDC->MoveTo(Origine().x+taille_graduation*j, Fin_ordonnee().y+10);
pDC->LineTo(Origine().x+taille_graduation*j, Fin_ordonnee().y+3);
}
//les unites
CFont font;
font.CreateFont(-10,0,0,0,FW_NORMAL,FALSE,FALSE,0,ANSI_CHARSET,OUT_DEVICE_PRECIS,
CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_SWISS, "Arial");
CFont* pOldFont = (CFont*) pDC->SelectObject(&font);
float duree_graduation =(float) taille_graduation / (float)nb_pixel_trame * (float)taille_trame;
CString str_unite;
str_unite.Format("Une graduation = %0.1f ms",duree_graduation);
pDC->TextOut(graphe_signal.Origine().x,
graphe_signal.Fin_ordonnee().y+10,str_unite);
//redessine le trait de base de la regle
pOldPen = pDC->SelectObject(&RulerPen);
pDC->MoveTo(graphe_signal.Origine().x,
graphe_signal.Fin_ordonnee().y+10);
pDC->LineTo((int)largeur_affichage-10,graphe_signal.Fin_ordonnee().y+10);
}
the fact of playing playing with the horizontal scoll bar just causes the whole app to crash
I get messages in the debug window like
Warning: Uncaught exception in WindowProc (returning 0).
First-chance exception in gds.exe (MSVCRTD.DLL): 0xE06D7363: Microsoft C++ Exception.
Any ideas are welcome,
thanks
###
#####
#######
#####
\\\|/// ###
| ~ ~ | #
(- * * -) #
------------oOOo-(_)-oO#o-----------
| #
^ #
" #
##