You can use member GetODBCFieldInfo of CRecordset: void GetODBCFieldInfo( short nIndex, CODBCFieldInfo& fieldinfo ); // Definition of CODBCFieldInfo struct CODBCFieldInfo { CString m_strName; //thats what you want SWORD m_nSQLType; UDWORD m_nPrecision; SWORD m_nScale; SWORD m_nNullability; };
tomiczek
Posts
-
Can I retrieve column names using MFC classes -
How to maximize a child window in a MDI projectoverwite the function ActivateFrame in your derived CMDIChildWnd class. usually it is called CChildFrame... implement it like this: void CChildFrame::ActivateFrame(int nCmdShow) { // TODO: Speziellen Code hier einfügen und/oder Basisklasse aufrufen nCmdShow = SW_SHOWMAXIMIZED; CMDIChildWnd::ActivateFrame(nCmdShow); }
-
CListCtrl improvingchange your code To CRect rect; //set rect GetSubItemRect(nItem, nCol, LVIR_LABEL, rect); CEdit *pEdit = new CInPlaceEdit(nItem, nCol, GetItemText(nItem, nCol), GetColumnType(nCol), rect);
-
MIDL: Compilation Errorwhy don't you import the idl-file where the referenced interface is declared as you do with normal C++ header? e.g. import "YourInterface.idl"; ... ... the you can use it... interface IOtherInterface : IYourInterface { ... };
-
CListCtrl improvingderive a Class from CEdit and overwite in ON_WM_WINDOWPOSCHANGING... add a Variable for the Size of the Subitem e.g RECT m_Position; In the Beginlabeledit-Handler of your ListCtrl SubClass the ListCtrl's EditCtrl with your derived class like this: OnBeginlabeledit(NMHDR* pNMHDR, LRESULT* pResult) { // Pseudo Code CREct Rect; GetSubItemRect(nItem, nSubItem, LVIR_LABEL, Rect); HWND hWnd=(HWND)SendMessage(LVM_GETEDITCONTROL); m_DerivedEdit.SubclassWindow(hWnd); m_DerivedEdit.SetPosition(Rect); } with SetPosition you should set the RECT m_Position of your derived Edit class... in the ON_WM_WINDOWPOSCHANGING - Handler you can adjust the Position of the ListCtrl's EditCtrl as follows: CDerivedEdit::OnWindowPosChanging(WINDOWPOS FAR* lpwndpos) { lpwndpos->x = m_Position.left; lpwndpos->y = m_Position.top; lpwndpos->cx = m_Position.Width(); lpwndpos->cy = m_Position.Height(); } Hope this helps...