Problem while switching from debugging mode to release mode
-
Hi, My project is working correctly in debug mode. My project is to draw a diagram after importing the corresponding files. And while i select some colors and select an item in the footprintlist in the dialog bar, the corresponding will be reflected in the drawing. this is going on fine in debug mode. But in release mode the drawing is as such. But after selecting the colors, and giving redraw, the primitives are getting drawn in some other location. How to solve this?
With Regards, Sangeetha.
-
Hi, My project is working correctly in debug mode. My project is to draw a diagram after importing the corresponding files. And while i select some colors and select an item in the footprintlist in the dialog bar, the corresponding will be reflected in the drawing. this is going on fine in debug mode. But in release mode the drawing is as such. But after selecting the colors, and giving redraw, the primitives are getting drawn in some other location. How to solve this?
With Regards, Sangeetha.
May be you have left some variables uninitialized. why dont you try debugging...
nave [OpenedFileFinder]
-
May be you have left some variables uninitialized. why dont you try debugging...
nave [OpenedFileFinder]
Hi Naveen, I learnt one article to debug even in release mode. i tried it. While am debugging and then seeing the output it is correct in release mode also. But without debugging in release mode, the output is not as expected. But its different. And i tried your suggestion also. The same problem still exists.
With Regards, Sangeetha.
-
Hi Naveen, I learnt one article to debug even in release mode. i tried it. While am debugging and then seeing the output it is correct in release mode also. But without debugging in release mode, the output is not as expected. But its different. And i tried your suggestion also. The same problem still exists.
With Regards, Sangeetha.
I hardly doubt this is because of some uninitialized varaiables. Are you using CRect or some thing like that? Paste the code. I will try to find.
nave [OpenedFileFinder]
-
I hardly doubt this is because of some uninitialized varaiables. Are you using CRect or some thing like that? Paste the code. I will try to find.
nave [OpenedFileFinder]
void CDocumentationView::BottomLayerView() { float div = 1000; float X1 = 0.000, Y1 = 0.000, X2 = 0.000, Y2 = 0.0; float XCen = 0.0, YCen = 0.0, wid = 0.0, hei = 0.0, dia = 0.0, rad = 0.0; BYTE Red = 0, Green = 0, Blue = 0; int size = FootPrintArray.GetSize(); for(int inc = 0; inc < size; inc++) { FootPrint* foot = (FootPrint*) FootPrintArray.GetAt(inc); if(foot -> color != 0) { m_color = foot -> color; Red = ((BYTE*)(&m_color))[0]; Green = ((BYTE*)(&m_color))[1]; Blue = ((BYTE*)(&m_color))[2]; int no = foot -> RefDes.GetSize(); CString temppinno = "\0"; float XStart = 0.0, YStart = 0.0; int pinnos = 0; glColor3ub(Red, Green, Blue); for(int incval = 0; incval < no; incval++) { CColoringComp* component = (CColoringComp*) foot -> RefDes.GetAt(incval); int pinno = component -> PinArray.GetSize(); for(int incval1 = 0; incval1 < pinno; incval1++) { CPinDetails* pin = (CPinDetails*) component -> PinArray.GetAt(incval1); int graphicno = pin -> GraphicData.GetSize(); for(int incval2 = 0; incval2 < graphicno; incval2++) { if(pin -> Mirror == "YES") { CGraphic* graphicdata = (CGraphic*) pin -> GraphicData.GetAt(incval2); if(graphicdata -> number <= 255) { XCen = graphicdata -> Data1; if(Mirrored) XCen = -(graphicdata -> Data1); YCen = graphicdata -> Data2; wid = graphicdata -> Data3; hei = graphicdata -> Data4; dia = graphicdata -> Data3; if(INCH == true) { XCen = (GLfloat) (XCen / 1000.00); YCen = (GLfloat) (YCen / 1000.00); wid = (GLfloat) (wid / 1000.00); hei = (GLfloat) (hei / 1000.00); dia = (GLfloat) (dia/1000.00); } else if(MILLIMETER == TRUE) { XCen = (GLfloat) (XCen / 1000.00); YCen = (GLfloat) (YCen / 1000.00); wid = (GLfloat) (wid / 1000.00); hei = (GLfloat) (hei / 1000.00); dia = (GLfloat) (dia/1000.00); wid = (GLfloat) (wid * 25.4); hei = (GLfloat) (hei * 25.4); dia = (GLfloat) (dia * 25.4); XCen = (GLfloat) (XCen * 25.4); YCen = (GLfloat) (YCen * 25.4); } if( (graphicdata -> Name.Find("RECTANGLE", 0) != -1) || (graphicdata -> Name.Find("SQUARE", 0) != -1) || (g
-
void CDocumentationView::BottomLayerView() { float div = 1000; float X1 = 0.000, Y1 = 0.000, X2 = 0.000, Y2 = 0.0; float XCen = 0.0, YCen = 0.0, wid = 0.0, hei = 0.0, dia = 0.0, rad = 0.0; BYTE Red = 0, Green = 0, Blue = 0; int size = FootPrintArray.GetSize(); for(int inc = 0; inc < size; inc++) { FootPrint* foot = (FootPrint*) FootPrintArray.GetAt(inc); if(foot -> color != 0) { m_color = foot -> color; Red = ((BYTE*)(&m_color))[0]; Green = ((BYTE*)(&m_color))[1]; Blue = ((BYTE*)(&m_color))[2]; int no = foot -> RefDes.GetSize(); CString temppinno = "\0"; float XStart = 0.0, YStart = 0.0; int pinnos = 0; glColor3ub(Red, Green, Blue); for(int incval = 0; incval < no; incval++) { CColoringComp* component = (CColoringComp*) foot -> RefDes.GetAt(incval); int pinno = component -> PinArray.GetSize(); for(int incval1 = 0; incval1 < pinno; incval1++) { CPinDetails* pin = (CPinDetails*) component -> PinArray.GetAt(incval1); int graphicno = pin -> GraphicData.GetSize(); for(int incval2 = 0; incval2 < graphicno; incval2++) { if(pin -> Mirror == "YES") { CGraphic* graphicdata = (CGraphic*) pin -> GraphicData.GetAt(incval2); if(graphicdata -> number <= 255) { XCen = graphicdata -> Data1; if(Mirrored) XCen = -(graphicdata -> Data1); YCen = graphicdata -> Data2; wid = graphicdata -> Data3; hei = graphicdata -> Data4; dia = graphicdata -> Data3; if(INCH == true) { XCen = (GLfloat) (XCen / 1000.00); YCen = (GLfloat) (YCen / 1000.00); wid = (GLfloat) (wid / 1000.00); hei = (GLfloat) (hei / 1000.00); dia = (GLfloat) (dia/1000.00); } else if(MILLIMETER == TRUE) { XCen = (GLfloat) (XCen / 1000.00); YCen = (GLfloat) (YCen / 1000.00); wid = (GLfloat) (wid / 1000.00); hei = (GLfloat) (hei / 1000.00); dia = (GLfloat) (dia/1000.00); wid = (GLfloat) (wid * 25.4); hei = (GLfloat) (hei * 25.4); dia = (GLfloat) (dia * 25.4); XCen = (GLfloat) (XCen * 25.4); YCen = (GLfloat) (YCen * 25.4); } if( (graphicdata -> Name.Find("RECTANGLE", 0) != -1) || (graphicdata -> Name.Find("SQUARE", 0) != -1) || (g
:doh:
nave [OpenedFileFinder]
-
:doh:
nave [OpenedFileFinder]
Hi Naveen, What happened? Is my code confusing?
With Regards, Sangeetha.
-
Hi Naveen, What happened? Is my code confusing?
With Regards, Sangeetha.
Sorry thats a lot of code.. also i havent used opengl yet.Is your whole drawing moving to some other place or only some perticular drawings. Other way to debug is using the OutputDebugString() function. you can watch the output using the DebugView[^]. So what am telling is that output your x and y coordinates to the debug view and check whether it is correct or not.
nave [OpenedFileFinder]
-
Sorry thats a lot of code.. also i havent used opengl yet.Is your whole drawing moving to some other place or only some perticular drawings. Other way to debug is using the OutputDebugString() function. you can watch the output using the DebugView[^]. So what am telling is that output your x and y coordinates to the debug view and check whether it is correct or not.
nave [OpenedFileFinder]
Okay.. I will check.. And let u know the result soon.. Please check the forum periodically by tomorrow.. please excuse me to say this.
With Regards, Sangeetha.
-
Okay.. I will check.. And let u know the result soon.. Please check the forum periodically by tomorrow.. please excuse me to say this.
With Regards, Sangeetha.
-
void CDocumentationView::BottomLayerView() { float div = 1000; float X1 = 0.000, Y1 = 0.000, X2 = 0.000, Y2 = 0.0; float XCen = 0.0, YCen = 0.0, wid = 0.0, hei = 0.0, dia = 0.0, rad = 0.0; BYTE Red = 0, Green = 0, Blue = 0; int size = FootPrintArray.GetSize(); for(int inc = 0; inc < size; inc++) { FootPrint* foot = (FootPrint*) FootPrintArray.GetAt(inc); if(foot -> color != 0) { m_color = foot -> color; Red = ((BYTE*)(&m_color))[0]; Green = ((BYTE*)(&m_color))[1]; Blue = ((BYTE*)(&m_color))[2]; int no = foot -> RefDes.GetSize(); CString temppinno = "\0"; float XStart = 0.0, YStart = 0.0; int pinnos = 0; glColor3ub(Red, Green, Blue); for(int incval = 0; incval < no; incval++) { CColoringComp* component = (CColoringComp*) foot -> RefDes.GetAt(incval); int pinno = component -> PinArray.GetSize(); for(int incval1 = 0; incval1 < pinno; incval1++) { CPinDetails* pin = (CPinDetails*) component -> PinArray.GetAt(incval1); int graphicno = pin -> GraphicData.GetSize(); for(int incval2 = 0; incval2 < graphicno; incval2++) { if(pin -> Mirror == "YES") { CGraphic* graphicdata = (CGraphic*) pin -> GraphicData.GetAt(incval2); if(graphicdata -> number <= 255) { XCen = graphicdata -> Data1; if(Mirrored) XCen = -(graphicdata -> Data1); YCen = graphicdata -> Data2; wid = graphicdata -> Data3; hei = graphicdata -> Data4; dia = graphicdata -> Data3; if(INCH == true) { XCen = (GLfloat) (XCen / 1000.00); YCen = (GLfloat) (YCen / 1000.00); wid = (GLfloat) (wid / 1000.00); hei = (GLfloat) (hei / 1000.00); dia = (GLfloat) (dia/1000.00); } else if(MILLIMETER == TRUE) { XCen = (GLfloat) (XCen / 1000.00); YCen = (GLfloat) (YCen / 1000.00); wid = (GLfloat) (wid / 1000.00); hei = (GLfloat) (hei / 1000.00); dia = (GLfloat) (dia/1000.00); wid = (GLfloat) (wid * 25.4); hei = (GLfloat) (hei * 25.4); dia = (GLfloat) (dia * 25.4); XCen = (GLfloat) (XCen * 25.4); YCen = (GLfloat) (YCen * 25.4); } if( (graphicdata -> Name.Find("RECTANGLE", 0) != -1) || (graphicdata -> Name.Find("SQUARE", 0) != -1) || (g
Do you seriously think that anyone is going to wade through all of this? :rolleyes:
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
Sorry thats a lot of code.. also i havent used opengl yet.Is your whole drawing moving to some other place or only some perticular drawings. Other way to debug is using the OutputDebugString() function. you can watch the output using the DebugView[^]. So what am telling is that output your x and y coordinates to the debug view and check whether it is correct or not.
nave [OpenedFileFinder]
Hi Naveen, CRect is there is another function
With Regards, Sangeetha.
-
Hi Naveen, What happened? Is my code confusing?
With Regards, Sangeetha.
If you are dealing with graphics ... there may be problem of object leaking. You can verify it by enabling GDI option in task manager and then running your code. May help you :).
--------------------------------- I cant lose any thing ... because I have nothing to lose.
-
May be you have left some variables uninitialized. why dont you try debugging...
nave [OpenedFileFinder]
Hi, Thanks for all.. And thank you very much Naveen for telling me about Debug View. I found out that the problem is with the format change of a statement in my input file using the debug view. And solved it.
With Regards, Sangeetha.