´ÙÀ̾î·Î±× ¹Ú½º¿¡¼ ÀÔÃâ·Â |
|||||||||||||||||||||||||||||||||||||||||||||
ÇнÀ¸ñÇ¥ |
|||||||||||||||||||||||||||||||||||||||||||||
¹öÆ°ÀÇ µ¿ÀÛ°ú ¿¡µðÅÍ ¹Ú½º¿¡¼ÀÇ ÀÔÃâ·ÂÀ» °øºÎÇÑ´Ù. |
|||||||||||||||||||||||||||||||||||||||||||||
ÇнÀÁÖÁ¦ |
|||||||||||||||||||||||||||||||||||||||||||||
´ÙÀ̾î·Î±× ¹Ú½º¿¡¼ ÀÔ·Ââ¿¡ ¼ýÀÚ¸¦ ÀÔ·ÂÇÏ°í ¹öÆ°À» ´·¯¼ ¸í·ÉÀ» ½ÇÇàÇϸé Ãâ·Ââ¿¡ ÀԷ°ªÀÇ 2¹èÀÇ °á°ú°¡ ³ªÅ¸³ª°Ô ÇÑ´Ù. |
|||||||||||||||||||||||||||||||||||||||||||||
¿¹½À³»¿ë |
|||||||||||||||||||||||||||||||||||||||||||||
´ÙÀ½ ÇÔ¼öÀÇ ±â´ÉÀ» ¾Ë¾Æ º»´Ù. UpdateData(TRUE) UpdateData(FALSE) |
|||||||||||||||||||||||||||||||||||||||||||||
½Ç½À¹æ¹ý |
|||||||||||||||||||||||||||||||||||||||||||||
¸ñ Â÷ |
|||||||||||||||||||||||||||||||||||||||||||||
1. »õ·Î¿î ÇÁ·ÎÁ§Æ®¸¦ ¸¸µç´Ù.
2. Project name ¿¡ Step1À̶ó°í À̸§À» ÁÖ°í [NI Measurment Studio AppWizard]¸¦ ¼±ÅÃÇÏ°íOK ¹öÆ°À» ´©¸¥´Ù.
3. LocationÀÇ ´ÜÃ߸¦ ´·¯ ÇÁ·ÎÁ§Æ®¸¦ ÀúÀåÇÒ µð·ºÅ丮¸¦ ¼³Á¤ÇÏ°í OK ¹öÆ°À» ´©¸¥´Ù.
4. ´ÙÀ½°úÁ¤Àº °è¼Ó µðÆúÆ® °ªÀ» ±×´ë·Î ³öµÎ°í Next ¹öÆ°À» ´©¸¥´Ù.
5. ´ÙÀ½°ú °°ÀÌ Å¬·¡½º¿Í ´ÙÀ̾î·Î±× ¹Ú½º°¡ ¸¸µé¾î Áø °ÍÀ» º¼ ¼ö ÀÖ´Ù.
OnButton1() ÇÔ¼ö¿¡ ´ÙÀ½À» Ãß°¡ÇÏ°í ÇÁ·Î±×·¥À» ÄÄÆÄÀÏ, ¸µÅ© ÇÑ ÈÄ¿¡ ½ÇÇàÇÑ´Ù.
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 Overview | Class Members | Hierarchy Chart See Also CWnd::DoDataExchange |