Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 26th, 2012  |  syntax: None  |  size: 1.31 KB  |  hits: 19  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. How can I insert System.windows.forms.datagridview to my dialog?
  2. // AccessDlg.h : header file
  3. //
  4.  
  5. #pragma once
  6. #include "stdafx.h"
  7.  
  8. // CAccessDlg dialog
  9. class CAccessDlg : public CDialog
  10. {
  11. // Construction
  12. public:
  13.     CAccessDlg(CWnd* pParent = NULL);   // standard constructor
  14.  
  15. // Dialog Data
  16.     enum { IDD = IDD_ACCESS_DIALOG };
  17.  
  18.     protected:
  19.     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  20.  
  21.     CWinFormsControl<System::Windows::Forms::DataGridView> m_DataGridView;
  22.  
  23. // Implementation
  24. protected:
  25.     HICON m_hIcon;
  26.  
  27.     // Generated message map functions
  28.     virtual BOOL OnInitDialog();
  29.     afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
  30.     afx_msg void OnPaint();
  31.     afx_msg HCURSOR OnQueryDragIcon();
  32.     DECLARE_MESSAGE_MAP()
  33. };
  34.  
  35. void CAccessDlg::DoDataExchange(CDataExchange* pDX)
  36. {
  37.     CDialog::DoDataExchange(pDX);
  38.     DDX_ManagedControl(pDX, IDC_GridView, m_DataGridView);
  39. }
  40.        
  41. error C2143: syntax error : missing ';' before '<'
  42. error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
  43. error C3083: 'Windows': the symbol to the left of a '::' must be a type
  44. error C3083: 'Forms': the symbol to the left of a '::' must be a type
  45. error C2039: 'DataGridView' : is not a member of 'System'
  46. error C2238: unexpected token(s) preceding
  47.        
  48. #include <afxwinforms.h>