Click here to Skip to main content
15,920,438 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to include a library file? Pin
Malini Nair23-Mar-07 0:26
Malini Nair23-Mar-07 0:26 
AnswerRe: How to include a library file? Pin
toxcct23-Mar-07 0:29
toxcct23-Mar-07 0:29 
AnswerRe: How to include a library file? Pin
Nibu babu thomas23-Mar-07 1:17
Nibu babu thomas23-Mar-07 1:17 
GeneralRe: How to include a library file? Pin
_808623-Mar-07 1:51
_808623-Mar-07 1:51 
GeneralRe: How to include a library file? Pin
Nibu babu thomas23-Mar-07 2:15
Nibu babu thomas23-Mar-07 2:15 
GeneralRe: How to include a library file? Pin
_808623-Mar-07 4:56
_808623-Mar-07 4:56 
GeneralRe: How to include a library file? Pin
Nibu babu thomas25-Mar-07 17:13
Nibu babu thomas25-Mar-07 17:13 
QuestionScrolling Text problem Pin
vinhcyim23-Mar-07 0:13
vinhcyim23-Mar-07 0:13 
Dear,
I am trying to create a MFC program to scroll some text.
I have already used the double buffering technology, however, there is still some flicker...
I want to do one without any flicker.
Is anyone who can help me???
Thanks a lot.
Here is my code

struct News
{
CString strNews;
int pos;
int initpos;
BOOL bDecrease;
};
CList<news*,news*> m_News;


void CTextScroller::OnTimer(UINT in)
{
if(in == 0)
{
CClientDC dc(this);
CRect rectClient;
GetClientRect(&rectClient);
MoveTextToLeft(&dc, rectClient);
}
CStatic::OnTimer(in);
}

void CTextScroller::MoveTextToLeft(CDC* pDC, CRect& r)
{
int count = m_News.GetCount();
if(!count)
return;

CDC memDC;
memDC.CreateCompatibleDC(pDC);

if(m_BmpMain.m_hObject == NULL)
{
m_BmpMain.CreateCompatibleBitmap( pDC, r.Width(), r.Height() );
}

memDC.SelectObject(&m_BmpMain);
memDC.SelectObject(&m_font);
memDC.SetBkMode(TRANSPARENT);
memDC.SetTextColor(m_TextColor);

News *_news = NULL;
CSize size;
POSITION pos = m_News.GetHeadPosition();

memDC.FillSolidRect(&r,m_BkColor);

while(pos)
{
_news = m_News.GetNext(pos);
if(!_news)
return;
size = memDC.GetTextExtent(_news->strNews);
if(_news->bDecrease)
_news->pos--;
if(_news->pos < r.left - size.cx)
continue;

//memDC.DrawText(_news->strNews,CRect(_news->pos, 0, _news->pos + size.cx, size.cy),DT_LEFT);
memDC.TextOutW(_news->pos, 0, _news->strNews);
}

pDC->BitBlt(0, 0, r.Width(), r.Height(), &memDC, 0, 0, SRCCOPY);
}
Answerposting guidelines Pin
toxcct23-Mar-07 0:16
toxcct23-Mar-07 0:16 
AnswerRe: Scrolling Text problem Pin
Mark Salsbery23-Mar-07 8:21
Mark Salsbery23-Mar-07 8:21 
QuestionSDI/ View Pin
_808623-Mar-07 0:10
_808623-Mar-07 0:10 
AnswerRe: SDI/ View Pin
RChin23-Mar-07 2:01
RChin23-Mar-07 2:01 
GeneralRe: SDI/ View Pin
_808623-Mar-07 0:52
_808623-Mar-07 0:52 
GeneralRe: SDI/ View Pin
_808623-Mar-07 2:11
_808623-Mar-07 2:11 
GeneralRe: SDI/ View Pin
cp987623-Mar-07 13:47
cp987623-Mar-07 13:47 
GeneralRe: SDI/ View Pin
_808624-Mar-07 5:56
_808624-Mar-07 5:56 
GeneralRe: SDI/ View Pin
_808624-Mar-07 5:57
_808624-Mar-07 5:57 
Questionstrings in c++ Pin
pariisa22-Mar-07 23:46
pariisa22-Mar-07 23:46 
AnswerRe: strings in c++ Pin
toxcct22-Mar-07 23:50
toxcct22-Mar-07 23:50 
GeneralRe: strings in c++ Pin
vijay_aroli23-Mar-07 0:08
vijay_aroli23-Mar-07 0:08 
AnswerRe: strings in c++ Pin
Paresh Chitte22-Mar-07 23:52
Paresh Chitte22-Mar-07 23:52 
AnswerRe: strings in c++ Pin
C Mahesh23-Mar-07 0:03
C Mahesh23-Mar-07 0:03 
AnswerRe: strings in c++ Pin
Stephen Hewitt23-Mar-07 12:06
Stephen Hewitt23-Mar-07 12:06 
Questionretrieving unicode string from database Pin
roli_sri22-Mar-07 23:44
roli_sri22-Mar-07 23:44 
QuestionRe: retrieving unicode string from database Pin
Paresh Chitte22-Mar-07 23:49
Paresh Chitte22-Mar-07 23:49 

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.