Click here to Skip to main content
15,919,245 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Window Position Pin
Richard MacCutchan18-Aug-13 20:56
mveRichard MacCutchan18-Aug-13 20:56 
GeneralRe: Window Position Pin
john563219-Aug-13 4:11
john563219-Aug-13 4:11 
GeneralRe: Window Position Pin
Richard MacCutchan19-Aug-13 5:06
mveRichard MacCutchan19-Aug-13 5:06 
GeneralRe: Window Position Pin
pasztorpisti19-Aug-13 6:09
pasztorpisti19-Aug-13 6:09 
GeneralRe: Window Position Pin
Richard MacCutchan19-Aug-13 20:33
mveRichard MacCutchan19-Aug-13 20:33 
GeneralRe: Window Position Pin
pasztorpisti20-Aug-13 2:03
pasztorpisti20-Aug-13 2:03 
QuestionRe: Window Position Pin
pasztorpisti18-Aug-13 23:47
pasztorpisti18-Aug-13 23:47 
QuestionSometimes it can not draw out graph Pin
xieeevil18-Aug-13 17:04
xieeevil18-Aug-13 17:04 
I wrote a mfc interface to draw graph and show calculated result. The calculated result is right.It can be showed on the interface everytime. But the graph can not show normally.Under the same condition, sometimes the graph is showed and sometimes it not. I have no idear why it happens. The code about drawing is as follows:

C++
CDC* pDC;
CRect rectPic;
void f_curve();
void CAISIDlg::OnBnClickedButton1()
{
  BeginWaitCursor();
  UpdateData(TRUE);
width=m_width;
     ...           //variable assignment
  UpdateData(FALSE);

  if( Read_data(FolderPath,dhPath)!=0 )  
{
   m_picDraw.GetClientRect(&rectPic);
   pDC = m_picDraw.GetDC();

   f_curve();   //draw graph

   m_transmisivity = ((long int)(transmisivity*1e5))/1e5; //show result
        m_BSE = BSE;                                           //show result
   UpdateData(FALSE);
}
EndWaitCursor();
}

the f_curve() function is called to draw graph,key code as follow:
C++
void f_curve()
{
  ...
  pDC->SelectObject(PenRed);
  pDC->MoveTo( (int)( (db_jinyan[0][0]-minX)*itlX ),
     (int)( (db_jinyan[1][0]-minY)*itlY ) 
             );

  for(int i=0;i<Len;i++)
pDC->LineTo( 
        (int)( (db_jinyan[0][i]-minX)*itlX ),
        (int)( (db_jinyan[1][i]-minY)*itlY ) 
           );
  ...
}

why the grapy can not be draw out everytime while the calculated result could?
AnswerRe: Sometimes it can not draw out graph Pin
Richard MacCutchan18-Aug-13 20:38
mveRichard MacCutchan18-Aug-13 20:38 
GeneralRe: Sometimes it can not draw out graph Pin
Rajesh R Subramanian18-Aug-13 21:57
professionalRajesh R Subramanian18-Aug-13 21:57 
GeneralRe: Sometimes it can not draw out graph Pin
Richard MacCutchan18-Aug-13 22:09
mveRichard MacCutchan18-Aug-13 22:09 
GeneralRe: Sometimes it can not draw out graph Pin
Vaclav_21-Aug-13 4:30
Vaclav_21-Aug-13 4:30 
GeneralRe: Sometimes it can not draw out graph Pin
Richard MacCutchan21-Aug-13 5:09
mveRichard MacCutchan21-Aug-13 5:09 
QuestionWaitForSingleObject Crash Pin
ForNow18-Aug-13 14:09
ForNow18-Aug-13 14:09 
AnswerRe: WaitForSingleObject Crash Pin
Stephen Hewitt18-Aug-13 19:53
Stephen Hewitt18-Aug-13 19:53 
AnswerRe: WaitForSingleObject Crash Pin
Erudite_Eric18-Aug-13 20:07
Erudite_Eric18-Aug-13 20:07 
GeneralRe: WaitForSingleObject Crash Pin
ForNow19-Aug-13 4:45
ForNow19-Aug-13 4:45 
GeneralRe: WaitForSingleObject Crash Pin
Jochen Arndt19-Aug-13 5:14
professionalJochen Arndt19-Aug-13 5:14 
GeneralRe: WaitForSingleObject Crash Pin
ForNow19-Aug-13 5:20
ForNow19-Aug-13 5:20 
GeneralRe: WaitForSingleObject Crash Pin
Stephen Hewitt19-Aug-13 20:32
Stephen Hewitt19-Aug-13 20:32 
AnswerRe: WaitForSingleObject Crash Pin
Richard MacCutchan18-Aug-13 20:35
mveRichard MacCutchan18-Aug-13 20:35 
QuestionWin32 Menu bitmaps Pin
Jonathan Davies17-Aug-13 10:43
Jonathan Davies17-Aug-13 10:43 
GeneralRe: Win32 Menu bitmaps Pin
Richard MacCutchan18-Aug-13 1:25
mveRichard MacCutchan18-Aug-13 1:25 
GeneralRe: Win32 Menu bitmaps Pin
Jonathan Davies18-Aug-13 5:20
Jonathan Davies18-Aug-13 5:20 
AnswerRe: Win32 Menu bitmaps Pin
pasztorpisti18-Aug-13 4:36
pasztorpisti18-Aug-13 4:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.