Click here to Skip to main content
15,886,761 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionWhat does this mean about the VC6/VS2003 compiler's option ( /O2 /Od) Pin
wangningyu29-Nov-09 14:17
wangningyu29-Nov-09 14:17 
AnswerRe: What does this mean about the VC6/VS2003 compiler's option ( /O2 /Od) Pin
Joe Woodbury29-Nov-09 15:54
professionalJoe Woodbury29-Nov-09 15:54 
AnswerRe: What does this mean about the VC6/VS2003 compiler's option ( /O2 /Od) Pin
David Crow29-Nov-09 15:55
David Crow29-Nov-09 15:55 
AnswerRe: What does this mean about the VC6/VS2003 compiler's option ( /O2 /Od) Pin
«_Superman_»29-Nov-09 18:47
professional«_Superman_»29-Nov-09 18:47 
GeneralRe: What does this mean about the VC6/VS2003 compiler's option ( /O2 /Od) Pin
wangningyu29-Nov-09 23:07
wangningyu29-Nov-09 23:07 
GeneralRe: What does this mean about the VC6/VS2003 compiler's option ( /O2 /Od) Pin
«_Superman_»30-Nov-09 5:16
professional«_Superman_»30-Nov-09 5:16 
AnswerRe: What does this mean about the VC6/VS2003 compiler's option ( /O2 /Od) Pin
Michael Schubert29-Nov-09 21:15
Michael Schubert29-Nov-09 21:15 
QuestionWhy I cannot have a ListControl in a CRecordView derived class? Pin
Larry Mills Sr29-Nov-09 7:09
Larry Mills Sr29-Nov-09 7:09 
Here's some code:

View declaration:

class CCookItDBView : public CRecordView
{
     enum{ IDD = IDD_COOKITDB_FORM };
     CMyDB* m_pSet;
// Attributes
public:
     CCookItDBDoc* GetDocument() const;

   void InsertItemsIngred();
   void SetExtendedIngred();
   void SetColumsIngred();// gives error at runtime NOT Compile time


// Operations
public:
     // Ingredients LC
     CListCtrl m_cIngred_LC;
     CRecipeDataVec m_vRecipe;
     CRecipeData m_cRecipeData;
.....
};

void CCookItDBView::DoDataExchange(CDataExchange* pDX)
{
     CRecordView::DoDataExchange(pDX);
     DDX_Control(pDX, IDC_INGRED_LC, m_cIngred_LC);IDC_INGRED_LC is the List Control and m_cIngred_LC is it's varable
     // you can insert DDX_Field* functions here to 'connect' your controls to the database fields, ex.
     // DDX_FieldText(pDX, IDC_MYEDITBOX, m_pSet->m_szColumn1, m_pSet);
     // DDX_FieldCheck(pDX, IDC_MYCHECKBOX, m_pSet->m_bColumn2, m_pSet);
     // See MSDN and ODBC samples for more information
}


void CCookItDBView::SetColumsIngred()
     {
     //CString csWorkDate = "";
     CString csAmt = "Amount:";
     CString csUnit = "Unit:";
     CString csIngred = "Ingredients:";
     // insert two columns (REPORT mode) and modify the new header items
     CRect rect;
     m_cIngred_LC.GetClientRect(&rect);// gives error at Runtime NOT compile Time
     int nColInterval = rect.Width()/7;

     m_cIngred_LC.InsertColumn(0, csAmt, LVCFMT_LEFT, nColInterval*2);
     m_cIngred_LC.InsertColumn(1, csUnit, LVCFMT_LEFT, nColInterval*2);
     m_cIngred_LC.InsertColumn(2, csIngred, LVCFMT_LEFT, nColInterval*2);
     }

A C++ programming language novice, but striving to learn

AnswerRe: Why I cannot have a ListControl in a CRecordView derived class? Pin
«_Superman_»29-Nov-09 8:18
professional«_Superman_»29-Nov-09 8:18 
GeneralRe: Why I cannot have a ListControl in a CRecordView derived class? Pin
Larry Mills Sr29-Nov-09 8:33
Larry Mills Sr29-Nov-09 8:33 
GeneralRe: Why I cannot have a ListControl in a CRecordView derived class? Pin
«_Superman_»29-Nov-09 8:45
professional«_Superman_»29-Nov-09 8:45 
GeneralRe: Why I cannot have a ListControl in a CRecordView derived class? Pin
Larry Mills Sr29-Nov-09 13:07
Larry Mills Sr29-Nov-09 13:07 
QuestionRe: Why I cannot have a ListControl in a CRecordView derived class? Pin
David Crow29-Nov-09 15:57
David Crow29-Nov-09 15:57 
AnswerRe: Why I cannot have a ListControl in a CRecordView derived class? Pin
Larry Mills Sr1-Dec-09 3:01
Larry Mills Sr1-Dec-09 3:01 
QuestionRe: Why I cannot have a ListControl in a CRecordView derived class? Pin
David Crow1-Dec-09 3:04
David Crow1-Dec-09 3:04 
AnswerRe: Why I cannot have a ListControl in a CRecordView derived class? Pin
Larry Mills Sr2-Dec-09 2:35
Larry Mills Sr2-Dec-09 2:35 
QuestionRe: Why I cannot have a ListControl in a CRecordView derived class? Pin
David Crow2-Dec-09 2:42
David Crow2-Dec-09 2:42 
AnswerRe: Why I cannot have a ListControl in a CRecordView derived class? Pin
Larry Mills Sr2-Dec-09 15:05
Larry Mills Sr2-Dec-09 15:05 
AnswerRe: Why I cannot have a ListControl in a CRecordView derived class? Pin
David Crow2-Dec-09 17:44
David Crow2-Dec-09 17:44 
GeneralRe: Why I cannot have a ListControl in a CRecordView derived class? Pin
Larry Mills Sr3-Dec-09 14:58
Larry Mills Sr3-Dec-09 14:58 
GeneralRe: Why I cannot have a ListControl in a CRecordView derived class? Pin
David Crow3-Dec-09 15:58
David Crow3-Dec-09 15:58 
GeneralRe: Why I cannot have a ListControl in a CRecordView derived class? Pin
Larry Mills Sr4-Dec-09 2:51
Larry Mills Sr4-Dec-09 2:51 
GeneralRe: Why I cannot have a ListControl in a CRecordView derived class? Pin
David Crow4-Dec-09 7:48
David Crow4-Dec-09 7:48 
GeneralRe: Why I cannot have a ListControl in a CRecordView derived class? Pin
Larry Mills Sr4-Dec-09 8:02
Larry Mills Sr4-Dec-09 8:02 
GeneralRe: Why I cannot have a ListControl in a CRecordView derived class? Pin
David Crow4-Dec-09 9:06
David Crow4-Dec-09 9:06 

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.