U++ framework
Do not panic. Ask here before giving up.

Home » U++ Library support » ScatterDraw & ScatterCtrl » Uninitialized variables in the file ScatterDraw.cpp will cause crash (Using Visual Studio 2013)
Uninitialized variables in the file ScatterDraw.cpp will cause crash (Using Visual Studio 2013) [message #45947] Sat, 30 January 2016 10:53 Go to previous message
kasome is currently offline  kasome
Messages: 78
Registered: July 2008
Location: Taiwan
Member
Uninitialized variables in the file ScatterDraw.cpp will cause crash (Using Visual Studio 2013)


In the file ScatterDraw.cpp, the following function

void ScatterDraw::DrawLegend(Draw& w, const Size &size, int scale) const {

.................................................

          int plotLeft, plotTop, rectWidth, rectHeight; // uninitialized variables

.................................................

         int left = plotLeft + legendPos.x*scale;      // will cause crash here

.................................................

}


just make sure the variables has been initialized before using it, that should fix the problem, i.e.

int plotLeft = 0, plotTop = 0, rectWidth = 0, rectHeight = 0;


the patched file and the original file will upload as the attachment file, please update. Very Happy
 
Read Message
Read Message
Previous Topic: New ZoomToFit() replaces FitToData()
Next Topic: New ShowProcessDlg()
Goto Forum:
  


Current Time: Wed Jun 10 19:50:41 GMT+2 2026

Total time taken to generate the page: 0.00426 seconds