Click here to Skip to main content
15,896,557 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: how can u enumerate tables given a database? Pin
devvvy19-Nov-02 18:16
devvvy19-Nov-02 18:16 
GeneralRe: how can u enumerate tables given a database? Pin
Christian Graus19-Nov-02 18:17
protectorChristian Graus19-Nov-02 18:17 
GeneralRe: how can u enumerate tables given a database? Pin
devvvy19-Nov-02 18:21
devvvy19-Nov-02 18:21 
GeneralRe: how can u enumerate tables given a database? Pin
Christian Graus19-Nov-02 19:41
protectorChristian Graus19-Nov-02 19:41 
AnswerRe: how can u enumerate tables given a database? Pin
RichardGrimmer19-Nov-02 22:01
RichardGrimmer19-Nov-02 22:01 
QuestionDetect CEdit number of lines? Pin
Anonymous19-Nov-02 16:40
Anonymous19-Nov-02 16:40 
AnswerRe: Detect CEdit number of lines? Pin
Anonymous19-Nov-02 19:38
Anonymous19-Nov-02 19:38 
AnswerRe: Detect CEdit number of lines? Pin
Roger Allen20-Nov-02 2:49
Roger Allen20-Nov-02 2:49 
Do you mean visible lines in the edit control? There is no limit to the number of lines a control can have upto the 64K byte limit of \r\n pairs 63336/2 = 32768 possible lines held.

If its just the number of lines the control could display without a scrollbar, then you can compute this by gettting the client area size of the control, the DC and the font, and then count the number of lines like this:

int ComputeLines(int ID)
{
CWnd *pWnd = GetDlgItem(ID) ;
if (!pWnd)
return 0;

CEdit *pEdit = static_cast<CEdit*>(pWnd);
if (!pEdit)
return 0 ;

CDC *pDC = pEdit->GetDC() ;
CFont *pFont = pEdit->GetFont();

CFont *pOldFont = pDC->SelectObject(pFont);
CRect rect ;

pEdit->GetCLientRect(&rect);
CSize size = pDC->GetTextExtent("A", 1);
pDC->SelectObject(pOldFont);
ReleaseDC(pDC);
return rect.Height() / size.cy;
}



OK, the above it untested and types directly so, it may, may not work correctly


Roger Allen
Sonork 100.10016

I have a terminal disease. Its called life!
GeneralRe: Detect CEdit number of lines? Pin
Anonymous20-Nov-02 20:35
Anonymous20-Nov-02 20:35 
GeneralRe: Detect CEdit number of lines? Pin
Anonymous20-Nov-02 20:38
Anonymous20-Nov-02 20:38 
Generalvery good samples on connection string format Pin
devvvy19-Nov-02 15:44
devvvy19-Nov-02 15:44 
GeneralRe: very good samples on connection string format Pin
PJ Arends19-Nov-02 19:56
professionalPJ Arends19-Nov-02 19:56 
GeneralCListCtrl and backgrounds Pin
Developer10119-Nov-02 14:39
Developer10119-Nov-02 14:39 
GeneralRe: CListCtrl and backgrounds Pin
Rickard Andersson2019-Nov-02 21:45
Rickard Andersson2019-Nov-02 21:45 
GeneralWaitable Timers Pin
Anonymous19-Nov-02 10:44
Anonymous19-Nov-02 10:44 
GeneralCEdit::LineLength question Pin
brianwelsch19-Nov-02 10:40
brianwelsch19-Nov-02 10:40 
GeneralRe: CEdit::LineLength question Pin
Chris Hambleton19-Nov-02 11:35
Chris Hambleton19-Nov-02 11:35 
GeneralRe: CEdit::LineLength question Pin
Chris Richardson19-Nov-02 18:39
Chris Richardson19-Nov-02 18:39 
GeneralRe: CEdit::LineLength question - DONE Pin
brianwelsch25-Nov-02 4:08
brianwelsch25-Nov-02 4:08 
GeneralMultithreading in NT Pin
Madmaximus19-Nov-02 10:23
Madmaximus19-Nov-02 10:23 
GeneralRe: Multithreading in NT Pin
Joaquín M López Muñoz19-Nov-02 11:42
Joaquín M López Muñoz19-Nov-02 11:42 
GeneralRe: Multithreading in NT Pin
Madmaximus20-Nov-02 2:11
Madmaximus20-Nov-02 2:11 
GeneralRe: Multithreading in NT Pin
Joaquín M López Muñoz20-Nov-02 2:30
Joaquín M López Muñoz20-Nov-02 2:30 
GeneralRe: Multithreading in NT Pin
Madmaximus21-Nov-02 4:18
Madmaximus21-Nov-02 4:18 
GeneralRe: Multithreading in NT Pin
Joaquín M López Muñoz21-Nov-02 7:50
Joaquín M López Muñoz21-Nov-02 7:50 

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.