Click here to Skip to main content
16,016,789 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: connecting to mysql server in remote location .. Pin
Stuart Dootson5-Feb-09 6:13
professionalStuart Dootson5-Feb-09 6:13 
GeneralRe: connecting to mysql server in remote location .. Pin
Thilek5-Feb-09 23:18
Thilek5-Feb-09 23:18 
QuestionIShellFolder::SetNameOf() setting only virtual folders Pin
ab4rum5-Feb-09 2:26
ab4rum5-Feb-09 2:26 
AnswerRe: IShellFolder::SetNameOf() setting only virtual folders Pin
Stuart Dootson5-Feb-09 6:23
professionalStuart Dootson5-Feb-09 6:23 
GeneralRe: IShellFolder::SetNameOf() setting only virtual folders Pin
ab4rum7-Feb-09 0:28
ab4rum7-Feb-09 0:28 
QuestionNeed help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
John5025-Feb-09 2:13
John5025-Feb-09 2:13 
AnswerRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
Stuart Dootson5-Feb-09 3:03
professionalStuart Dootson5-Feb-09 3:03 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
John5025-Feb-09 20:04
John5025-Feb-09 20:04 
Hi Stuart,
It is very urgent requirement for me, that's the reason i did like that.
Any way thanks for your suggesion.
I am using below code snippet for moving vertical scroll bar.
int nDelta;
int nMaxPos = m_rcOriginalRect.Height() - m_nCurHeight;

vscroll_clicked = TRUE;

switch (nSBCode)
{
case SB_LINEDOWN:

if (m_nScrollPos >= nMaxPos)
return;

nDelta = min(max(nMaxPos/20,5),nMaxPos-m_nScrollPos);

break;

case SB_LINEUP:
if (m_nScrollPos <= 0)
return;
nDelta = -min(max(nMaxPos/20,5),m_nScrollPos);
break;
case SB_PAGEDOWN:
if (m_nScrollPos >= nMaxPos)
return;
nDelta = min(max(nMaxPos/10,5),nMaxPos-m_nScrollPos);
break;

case SB_THUMBTRACK:
case SB_THUMBPOSITION:
nDelta = (int)nPos - m_nScrollPos;
break;

case SB_PAGEUP:
if (m_nScrollPos <= 0)
return;
nDelta = -min(max(nMaxPos/10,5),m_nScrollPos);
break;

default:
return;
}
m_nScrollPos += nDelta;
SetScrollPos(SB_VERT,m_nScrollPos,TRUE);
ScrollWindow(0,-nDelta);

And i am using below code snippet in ONPaint() funcion, for drawing images.

CPaintDC dc(this); // device context for painting

HBITMAP m_Bmap;
CRect rect;
HDC memdc;

CString m_ifilename1,m_ifilename2;

m_ifilename2 = "C:\\Venkatesh\\Sample1.bmp";

GetClientRect(&rect);

m_Bmap=(HBITMAP)::LoadImage(NULL,m_ifilename2,IMAGE_BITMAP,600,39,LR_LOADFROMFILE | LR_DEFAULTSIZE) ;
memdc=::CreateCompatibleDC(dc.m_hDC);
::SelectObject(memdc,m_Bmap);

BitBlt(dc.m_hDC,70,180,rect.right,rect.bottom,memdc,0,0,SRCCOPY);

m_Bmap=(HBITMAP)::LoadImage(NULL,m_ifilename2,IMAGE_BITMAP,600,39,LR_LOADFROMFILE | LR_DEFAULTSIZE) ;
memdc=::CreateCompatibleDC(dc.m_hDC);
::SelectObject(memdc,m_Bmap);

BitBlt(dc.m_hDC,70,500,rect.right,rect.bottom,memdc,0,0,SRCCOPY);

DeleteObject(m_Bmap);
DeleteObject(memdc);

I think based on this code you should be able to understand my problem
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
Stuart Dootson5-Feb-09 21:34
professionalStuart Dootson5-Feb-09 21:34 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
John5026-Feb-09 5:13
John5026-Feb-09 5:13 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
Stuart Dootson6-Feb-09 5:50
professionalStuart Dootson6-Feb-09 5:50 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
John5026-Feb-09 6:24
John5026-Feb-09 6:24 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
Stuart Dootson6-Feb-09 7:16
professionalStuart Dootson6-Feb-09 7:16 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
John5026-Feb-09 7:35
John5026-Feb-09 7:35 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
Stuart Dootson6-Feb-09 8:03
professionalStuart Dootson6-Feb-09 8:03 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
John5028-Feb-09 4:14
John5028-Feb-09 4:14 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
Stuart Dootson8-Feb-09 6:38
professionalStuart Dootson8-Feb-09 6:38 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
John5028-Feb-09 7:05
John5028-Feb-09 7:05 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
Stuart Dootson8-Feb-09 8:01
professionalStuart Dootson8-Feb-09 8:01 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
John5028-Feb-09 9:59
John5028-Feb-09 9:59 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
Stuart Dootson8-Feb-09 10:28
professionalStuart Dootson8-Feb-09 10:28 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
Stuart Dootson8-Feb-09 22:07
professionalStuart Dootson8-Feb-09 22:07 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
John5029-Feb-09 3:05
John5029-Feb-09 3:05 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
John50210-Feb-09 7:00
John50210-Feb-09 7:00 
GeneralRe: Need help on how to create image on child window and have to move along with vertical scroll bar to my dialog box Pin
Stuart Dootson10-Feb-09 8:17
professionalStuart Dootson10-Feb-09 8:17 

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.