ÇнÀ¸ñÇ¥    1

ÇнÀÁÖÁ¦    1

¿¹½À³»¿ë    1

½Ç½À¹æ¹ý    1

°ú    Á¦    1

Áß¿äÇÔ¼ö    1

´ÙÀ̾î·Î±× ¹Ú½º¿¡¼­ ÀÔÃâ·Â

ÇнÀ¸ñÇ¥

¹öÆ°ÀÇ µ¿ÀÛ°ú ¿¡µðÅÍ ¹Ú½º¿¡¼­ÀÇ ÀÔÃâ·ÂÀ» °øºÎÇÑ´Ù.

ÇнÀÁÖÁ¦

´ÙÀ̾î·Î±× ¹Ú½º¿¡¼­ ÀÔ·Ââ¿¡ ¼ýÀÚ¸¦ ÀÔ·ÂÇÏ°í ¹öÆ°À» ´­·¯¼­ ¸í·ÉÀ» ½ÇÇàÇϸé Ãâ·Ââ¿¡ ÀԷ°ªÀÇ 2¹èÀÇ °á°ú°¡ ³ªÅ¸³ª°Ô ÇÑ´Ù.

¿¹½À³»¿ë

´ÙÀ½ ÇÔ¼öÀÇ ±â´ÉÀ» ¾Ë¾Æ º»´Ù.

UpdateData(TRUE)

UpdateData(FALSE)

½Ç½À¹æ¹ý

¸ñ    Â÷

1.                    »õ·Î¿î ÇÁ·ÎÁ§Æ®¸¦ ¸¸µç´Ù.

2. Project name ¿¡ Step1À̶ó°í À̸§À» ÁÖ°í [NI Measurment Studio AppWizard]¸¦ ¼±ÅÃÇÏ°íOK ¹öÆ°À» ´©¸¥´Ù.

óÀ½

µð·ºÅ丮 ¼±ÅÃ
 


3. LocationÀÇ      ´ÜÃ߸¦ ´­·¯ ÇÁ·ÎÁ§Æ®¸¦ ÀúÀåÇÒ µð·ºÅ丮¸¦ ¼³Á¤ÇÏ°í OK ¹öÆ°À» ´©¸¥´Ù.

 

4. ´ÙÀ½°úÁ¤Àº °è¼Ó µðÆúÆ® °ªÀ» ±×´ë·Î ³öµÎ°í Next ¹öÆ°À» ´©¸¥´Ù.

óÀ½

óÀ½

 

5. ´ÙÀ½°ú °°ÀÌ Å¬·¡½º¿Í ´ÙÀ̾î·Î±× ¹Ú½º°¡ ¸¸µé¾î Áø °ÍÀ» º¼ ¼ö ÀÖ´Ù.

µµ±¸¸ðÀ½ â¿¡¼­ Edit Box¸¦ ¼±ÅÃÇÏ¿© ´ÙÀ̾î·Î±× ¹Ú½º¿¡ 2°³¸¦ ¸¸µç´Ù.

óÀ½

µµ±¸¸ðÀ½¿¡¼­ ButtonÀ» ´ÙÀ̾î·Î±× â¿¡ ¸¸µç´Ù.                                

Edit¸¦ ¼±ÅÃÇÏ°í ¸¶¿ì½º ¿À¸¥ÂÊ ¹öÆ°À» ´­·¯ Properties¸¦ ¼±ÅÃÇÏ¸é µî·ÏµÈ ID¸¦ º¼ ¼ö ÀÖ´Ù. IDC_EDIT1, IDC_EDIT2 , IDC_BUTTON1À¸·Î µî·ÏµÇ¾î ÀÖ´Ù.

 

 

 

óÀ½

¸Þ´º View¿¡¼­ ClassWizard¸¦ ¼±ÅÃÇÑ´Ù.

IDC_EDIT1À» ¼±ÅÃÇÏ°í Add VariableÀ» ¼±ÅÃÇÏ°í ¾Æ·¡¿Í °°ÀÌ Ã¤¿ì°í OK ¹öÆ°À» ´©¸¥´Ù.

óÀ½

°°Àº ¹æ¹ýÀ¸·Î IDC_EDIT2µµ ¾Æ·¡¿Í °°ÀÌ ÀÔ·ÂÇÑ´Ù.

´ÙÀ̾î·Î±× â¿¡¼­ Button1ÀÇ ´ÜÃ߸¦ ¸¶¿ì½º ¿ÞÂÊ ¹öÆ°À» µÎ¹ø Å©¶ôÇÏ¸é ´ÙÀ½°ú °°ÀÌ OnButton1À̶ó´Â ÇÔ¼ö¸¦ ¸¸µé ¼ö ÀÖ´Ù. ÇÁ·Î±×·¥ ½ÇÇà½Ã¿¡ ¸¶¿ì½º¸¦ Å©¸¯Çϸé ÀÌ ÇÔ¼ö°¡ ½ÇÇà µÈ´Ù.

óÀ½

Cstep1Dlg Ŭ·¡½º¿¡ ÇÔ¼ö°¡ Ãß°¡ µÈ °ÍÀ» º¼ ¼ö ÀÖ´Ù.

OnButton1() ÇÔ¼ö¿¡ ´ÙÀ½À» Ãß°¡ÇÏ°í ÇÁ·Î±×·¥À» ÄÄÆÄÀÏ, ¸µÅ© ÇÑ ÈÄ¿¡ ½ÇÇàÇÑ´Ù.

void CStep1Dlg::OnButton1()

{

              // TODO: Add your control notification handler code here                                 

              UpdateData(TRUE);                             // ¿¡µðƮâÀÇ °ªÀ» °¡Á®¿Â´Ù.

              m_edit2 = m_edit1*2;                    // ¿¬»êÀ» ÇÑ´Ù.

              UpdateData(FALSE);                           // ¿¡µðƮâÀ¸·Î °ªÀ» Ãâ·ÂÇÑ´Ù.

}

óÀ½

 

void CA2Dlg::InitTable()

{

              // Ä÷³¿¡ ´ëÇÑ Á¤º¸¸¦ ÀúÀåÇÏ´Â ±¸Á¶Ã¼

              LV_COLUMN lvcolumn;

 

              // ¼³Á¤ÇÒ Ç׸ñµéÀ» ¸í½ÃÇÔ

              lvcolumn.mask = LVCF_FMT|LVCF_SUBITEM|LVCF_TEXT|LVCF_WIDTH;

 

              // Ä÷³ Çì´õ¸¦ Áß¾Ó¿¡ Ãâ·ÂÇϵµ·Ï ÇÔ

              lvcolumn.fmt = LVCFMT_CENTER;

 

              for(int i = 0 ; i < 5 ; i++ )

              {

                             lvcolumn.iSubItem = i;

                             switch(i)

                             {

                             case 0:    // ù¹ø° Ä÷³ Á¤º¸ ¼³Á¤

                                           lvcolumn.cx = 50;

                                           lvcolumn.pszText = "¹øÈ£";

                                           break;

                             case 1:    // µÎ¹ø° Ä÷³ Á¤º¸ ¼³Á¤

                                           lvcolumn.cx = 50;

                                           lvcolumn.pszText = "±¹¾î";

                                           break;

                             case 2:    // ¼¼¹ø° Ä÷³ Á¤º¸ ¼³Á¤

                                           lvcolumn.cx = 50;

                                           lvcolumn.pszText = "¿µ¾î";

                                           break;

                             case 3:    // ³×¹ø° Ä÷³ Á¤º¸ ¼³Á¤

                                           lvcolumn.cx = 50;

                                           lvcolumn.pszText = "ÇÕ°è";

                                           break;

                             case 4:    // ´Ù¼¸¹ø° Ä÷³ Á¤º¸ ¼³Á¤

                                           lvcolumn.cx = 50;

                                           lvcolumn.pszText = "Æò±Õ";

                                           break;

                             }

                             m_ctrlList.InsertColumn(i, &lvcolumn);  // Ä÷³ Ãß°¡

              }

}

 

void CA2Dlg::WriteList()

{

              m_ctrlList.DeleteAllItems( );   // ¸®½ºÆ®¿¡ ÀÖ´Â °ÍÀ» ¸ðµÎ Áö¿î´Ù.

              // ±âÁ¸ ÆÄÀÏÀ» ¿­¾úÀ» ¶§ Å×À̺í ÀÛ¼º

 

              LV_ITEM lvitem;

              lvitem.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_STATE;

              lvitem.iSubItem = 0;

              lvitem.iImage = 2;

              lvitem.stateMask = LVIS_STATEIMAGEMASK;

              lvitem.state = INDEXTOSTATEIMAGEMASK(1);

              lvitem.pszText = "";

 

              int i;

              CString strIms;

              Man *a;

              a=init;

 

              for(i=0;i<10;i++) {

                             lvitem.iItem = m_ctrlList.GetItemCount();

                             m_ctrlList.InsertItem(&lvitem);

 

                             strIms.Empty();

                             strIms.Format("%d",a->no);

                             m_ctrlList.SetItemText(lvitem.iItem, 0, strIms);

 

                             strIms.Empty();

                             strIms.Format("%d",a->kor);

                             m_ctrlList.SetItemText(lvitem.iItem, 1, strIms);

 

                             strIms.Empty();

                             strIms.Format("%d",a->eng);

                             m_ctrlList.SetItemText(lvitem.iItem, 2, strIms);

 

                             strIms.Empty();

                             strIms.Format("%d",a->sum);

                             m_ctrlList.SetItemText(lvitem.iItem, 3, strIms);

 

                             strIms.Empty();

                             strIms.Format("%d",a->ave);

                             m_ctrlList.SetItemText(lvitem.iItem, 4, strIms);

                             a++;

              }

}

°ú    Á¦

1ºÎÅÍ ÀÔ·ÂÇÑ ¼ýÀÚ±îÁöÀÇ ÇÕÀ» ±¸ÇÑ´Ù.

Áß¿äÇÔ¼ö

´ÙÀ½Àº MSDN Lib¿¡ ÀÖ´Â °ÍÀ» ³ªÅ¸³½ °ÍÀÌ´Ù.

CWnd::UpdateData

BOOL UpdateData( BOOL bSaveAndValidate = TRUE );

Return Value

Nonzero if the operation is successful; otherwise 0. If bSaveAndValidate is TRUE, then a return value of nonzero means that the data is successfully validated.

Parameters

bSaveAndValidate

Flag that indicates whether dialog box is being initialized (FALSE) or data is being retrieved (TRUE).

Remarks

Call this member function to initialize data in a dialog box, or to retrieve and validate dialog data.

The framework automatically calls UpdateData with bSaveAndValidate set to FALSE when a modal dialog box is created in the default implementation of CDialog::OnInitDialog. The call occurs before the dialog box is visible. The default implementation of CDialog::OnOK calls this member function with bSaveAndValidate set to TRUE to retrieve the data, and if successful, will close the dialog box. (If the Cancel button is clicked in the dialog box, the dialog box is closed without the data being retrieved.)

CWnd OverviewClass MembersHierarchy Chart

See Also   CWnd::DoDataExchange

óÀ½