Bonjour à tous,

J'ai développé une application sous Windows XP qui crée et affiche des pages HTML à partir de fichiers texte formattés contenant des données statistiques.
Lors de tests sur une autre machine sous Windowns NT "allégé", j'ai un plantage bizarre : quand on affiche certaines fenêtres pour la deuxième fois, l'ordinateur émet deux bips consécutifs et l'application est quittée, sans message d'erreur.
J'ai bien sûr vérifié de ne pas avoir laissé trainer de Beep(). Est-ce que quelqu'un a déjà eu ce genre de comportement ?

Le plantage semble avoir lieu dans cette fonction (je dis bien semble car je ne peux pas lancer l'appli sous NT en debug) :
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
// saves the graph to a PNG image
void CGraph::saveToPNG(CString path, int width /* = 0 */, int height /* = 0 */)
{
	SLayout imgLayout;
	imgLayout._is_valid = false;
 
	if (width != 0)
	{
		// width/height specified
		imgLayout._global = RectF(0, 0, (float)width, (float)height);
	}
	else
	{
		// no width specified, use the screen layout size
		imgLayout._global = m_screen_layout._global;
		SizeF size;
		imgLayout._global.GetSize(&size);
		width = (int)size.Width;
		height = (int)size.Height;
	}
 
	// creates a bitmap the right size
	Bitmap image(width, height);
 
	// creates a Graphics object based on the image
	Graphics g(&image);
 
	// smooth drawing with antialias
	g.SetSmoothingMode(SmoothingModeAntiAlias);
 
	// fills the background
	SolidBrush* b = new SolidBrush(m_cfg._brush_color);
	g.FillRectangle(b, getRect(imgLayout._global));
	delete b;
 
	// outline uses the fill color when exporting, so no border is visible
	Pen* p = new Pen(m_cfg._brush_color);
	g.DrawRectangle(p, getRect(imgLayout._global));
	delete p;
 
	// draws everything
	drawAll(g, imgLayout);
 
	// saves the image.
	CLSID pngClsid;
	Utils::GetEncoderClsid(L"image/png", &pngClsid);
	BSTR finalPath = path.AllocSysString();
	image.Save(finalPath, &pngClsid, NULL);
}