Click here to Skip to main content
16,005,038 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: gsm program Pin
CPallini31-May-09 20:24
mveCPallini31-May-09 20:24 
QuestionAuto Scroll Vertical to the last line Pin
susanne131-May-09 5:48
susanne131-May-09 5:48 
AnswerRe: Auto Scroll Vertical to the last line Pin
«_Superman_»31-May-09 19:30
professional«_Superman_»31-May-09 19:30 
GeneralRe: Auto Scroll Vertical to the last line Pin
susanne12-Jun-09 4:56
susanne12-Jun-09 4:56 
QuestionI am gettin the E_DRM_SERVER_NOT_FOUND while doing the OnlinePublishing in AD RMS Application Pin
deadlyabbas31-May-09 2:48
deadlyabbas31-May-09 2:48 
Questiondlls compatibility Pin
prithaa31-May-09 1:17
prithaa31-May-09 1:17 
AnswerRe: dlls compatibility Pin
Stuart Dootson31-May-09 13:27
professionalStuart Dootson31-May-09 13:27 
QuestionI want no flicking this Dialog picture Please help! [modified] Pin
UGIF30-May-09 23:02
UGIF30-May-09 23:02 
I can't attach my code, so I linked my blog's post;
that post has attachment of my code
http://memolog.blog.naver.com/ytkim4558/176[^]
This source examples for my project
this is MFC source code.
When I dragged scrolling picture, It happened line...
sorry, I poor in English.
I thought this problem can solve with double buffering, but
all example, before I aleady saw, were have no component like edit box.

and under code is part of my code.

void CChild2::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
// TODO: Add your message handler code here and/or call default

int yInc=0, yMove=0;
int nYCur=GetScrollPos(SB_VERT);
int nMin=0, nMax=0;
CRect crt;

switch (nSBCode)
{
case SB_LINEUP:
yInc=-1;
break;
case SB_LINEDOWN:
yInc=1;
break;
case SB_PAGEUP:
yInc=-20;
break;
case SB_PAGEDOWN:
yInc=20;
break;
case SB_THUMBTRACK:
case SB_THUMBPOSITION:
yInc=nPos-nYCur;
break;
default:
break;
}

GetClientRect(&crt);
GetScrollRange(SB_VERT, &nMin, &nMax);
nMax-=crt.bottom;

yMove=nYCur+yInc;
if (nYCur+yInc < nMin)
{
yInc=-nYCur;
}else if (nYCur+yInc > nMax)
{
yInc=nMax-nYCur;
}
nYCur=nYCur+yInc;
ScrollWindow(0, -yInc);
SetScrollPos(SB_VERT,nYCur);
// InvalidateRect(NULL);

CDialog::OnVScroll(nSBCode, nPos, pScrollBar);
}

void CChild2::OnSize(UINT nType, int cx, int cy)
{
CDialog::OnSize(nType, cx, cy);

// TODO: Add your message handler code here
SCROLLINFO si;
int nYCur=0;

if (bStartReSize==TRUE)
{
nYOrgHeight=cy;
bStartReSize=FALSE;
}

nYCur=GetScrollPos(SB_VERT);
si.cbSize=sizeof(SCROLLINFO);
si.fMask=SIF_ALL | SIF_DISABLENOSCROLL;
si.nMin=0;
si.nMax=nYOrgHeight;
si.nPage=cy;
si.nPos=nYCur;

SetScrollInfo(SB_VERT, &si, TRUE);


}

BOOL CChild2::OnEraseBkgnd(CDC* pDC)
{
// TODO: Add your message handler code here and/or call default
// 사용자가 정의한 배경 그리기 루틴이 CDialog::OnEraseBkgnd 함수보다 먼저
// 위치하면 기본 대화상자 그리기 루틴에 의해서 아무것도 나오지 않는다. 따라서
// 항상 자기가 표시하고 싶은 정보는 CDialog::OnEraseBkgnd 함수보다 아래쪽에
// 정의 해야한다.
BOOL ret = CDialog::OnEraseBkgnd(pDC);
CRect r;
// 대화상자의 크기를 얻는다.
GetClientRect(r);

// 현재 DC에 자신이 생성한 블러쉬를 사용하도록 설정한다.
CBrush *p_old_brush = pDC->SelectObject(&m_bk_brush);

// 대화상자의 크기보다 패턴블러쉬에 사용된 이미지가 작다면 Tile 형식으로
// 이미지가 채워진다.
pDC->Rectangle(r);

// 이전에 사용한던 블러쉬로 복구한다.
pDC->SelectObject(p_old_brush);

return ret;
}

BOOL CChild2::OnInitDialog()
{
CDialog::OnInitDialog();

// TODO: Add extra initialization here
// 리소스 파일에서 비트맵을 읽어 들인다.
m_logo_bitmap.LoadBitmap(IDB_BITMAP3);//4
// 읽어 들인 비트맵을 이용하여 패턴 블러쉬를 생성한다.
m_bk_brush.CreatePatternBrush(&m_logo_bitmap);

return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}

modified on Sunday, May 31, 2009 5:12 AM

AnswerRe: I want no flicking this Dialog picture Please help! Pin
asrelu1-Jun-09 13:41
asrelu1-Jun-09 13:41 
GeneralRe: I want no flicking this Dialog picture Please help! Pin
UGIF2-Jun-09 2:22
UGIF2-Jun-09 2:22 
GeneralRe: I want no flicking this Dialog picture Please help! Pin
asrelu5-Jun-09 11:19
asrelu5-Jun-09 11:19 
QuestionGPU Pin
Michae_geffen30-May-09 21:29
Michae_geffen30-May-09 21:29 
QuestionSoftware HEAP bug Pin
transoft30-May-09 12:04
transoft30-May-09 12:04 
AnswerRe: Software HEAP bug Pin
Stuart Dootson30-May-09 12:51
professionalStuart Dootson30-May-09 12:51 
QuestionVisual Basics Program Ideas? Pin
carleyt30-May-09 6:22
carleyt30-May-09 6:22 
QuestionRe: Visual Basics Program Ideas? Pin
David Crow30-May-09 10:56
David Crow30-May-09 10:56 
Questiona socket problem Pin
tyr200029-May-09 22:46
tyr200029-May-09 22:46 
AnswerRe: a socket problem Pin
Rajesh R Subramanian30-May-09 0:08
professionalRajesh R Subramanian30-May-09 0:08 
AnswerRe: a socket problem Pin
CPallini30-May-09 2:30
mveCPallini30-May-09 2:30 
AnswerRe: a socket problem Pin
luxiaokang30-May-09 15:15
luxiaokang30-May-09 15:15 
GeneralRe: a socket problem Pin
Luc Pattyn30-May-09 15:45
sitebuilderLuc Pattyn30-May-09 15:45 
GeneralRe: a socket problem Pin
fanronghua30-May-09 22:36
fanronghua30-May-09 22:36 
AnswerRe: a socket problem Pin
tyr200031-May-09 0:00
tyr200031-May-09 0:00 
GeneralRe: a socket problem Pin
Luc Pattyn31-May-09 1:49
sitebuilderLuc Pattyn31-May-09 1:49 
GeneralRe: a socket problem Pin
tyr200031-May-09 23:14
tyr200031-May-09 23:14 

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.