|
Please try this -
ptrOutput->GetRichEditCtrl().LineScroll(0x7FFFFFFF);
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Thanks for your help it works but the text in the outputput window is hidden till i click the vertical scroll bar?? please help to fix this problem.
|
|
|
|
|
Please help me out of this as I am not able to get the output
|
|
|
|
|
Hello,
I have made dlls using VC++ of my classes which pure c++ . Will they be compatible with Turbo C and Borland C++
Priya
|
|
|
|
|
Seems unlikely if they resolve exports by name rather than ordinal - C++ exports are mangled, and most different compilers use different mangling schemes.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
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
|
|
|
|
|
Your blog is in Chinese, a language most of us don't speak.
From your code you ommitted the most important part, the OnPaint function.
Not knowing what you have there I can only give you general advises.
If you have a picture in the window, when you paint the background you delete the picture, and after that you paint it again. That will cause flickering.
Repaint the background only in the portions where there is no other graphics. Basically make sure that during a repaint of the window, every pixel is repainted only once.
Never clear anything from the window. Just overwrite.
Double buffering is the best, just don't forget, dont delete anything from the screen and don't repaint the background where it's not necessary. Only overwrite.
Do not use ScrollWindow to scroll the image, repaint everything to the nev position. If your window is partially covered by another window, the portion of the image scrolled out from under the other window will be black (or whatever the background color is).
If you're trying to scroll the controls form a dialog box, you don't need graphics processing.
Each control in the dialog is a window. Obtain a CWnd* pointer to each of them using GetDlgItem, then move the control using MoveWindow.
Frankly I think scrolling controls is a very unusual way to deal with dialogs. If you have too many controls you should consider using multiple dialog boxes, or maybe, a property page.
|
|
|
|
|
Thanks for your kind replyment.
Yes, I tried scroll the controls from a dialog box. But also, I tried wrapping image for design.
And I aleady said before post's code(not my blog) , which I before posted, was part of source code.
Full code has http://memolog.blog.naver.com/ytkim4558/176[^]
and the name is 하하(2)-7780-ytkim4558.zip - that is a full source code.
But, your reply gives me much rescue.
Thanks very much.
|
|
|
|
|
I saw your code. I can now underststand clearly what is your intention.
Lets rephrase:
You have a tab control in a dialog. In the tab control's display area you want to display a dialog that is bigger than the display area. You use a scroll bar to scroll the content of the dialog. You have a background image in that dialog, and you want that image to remain in one place and only the controls to move when the dialog is scrolled.
In your code there are two problems that cause flickerind. A small problem and a big problem.
The small problem is the line:
BOOL ret = CDialog::OnEraseBkgnd(pDC);
in the CChild2::OnEraseBkgnd function. When you call that function, your picture will be erased with the default brush (defined in the WNDCLASS). Then you paint back your picture on the screen. The erasing and repainting will cause flickering.
The solution is simple, delete that line and return TRUE when finishing the CChild2::OnEraseBkgnd function.
The big problem is that when you scroll the window you move the background (up or down) and after that repaint the background back to it's old position. Because of that, your picture moves up and down quickly and that causes another flickering. This problem is difficult because you MUST scroll the window, and after that you MUST repaint the background image.
The solution is to change fundamentally the way you do the job
Instead of having one dialog with controls in it and a picture in the background, you will need two windows, one dialog box with all the controls in it having a transparent background, and another window with the picture placed behind your dialog. The transparent dialog will alow you to see the picture in the other window. When you scroll your dialog, the picture will not move because it's in the other window, so there is no need to repaint it.
In order to make the dialog transparent, you need to create it with the style WS_EX_LAYERED, then call the SetLayeredWindowAttributes function.
These are new features, the VS 6 doesn't know them. But the function is in the user32.dll file and the WS_EX_LAYERED is defined as being 0x00080000 . If you know how to call a function from a dll you can solve the problem.
I found your problem challenging and I made a project with the technique I described. There is no flickering at all. If you let me know your email address I will send you the full project.
|
|
|
|
|
I am using a GPU to accelerate my application ,But I am facing a trivial problem , during the process Th PC can't use GPU for GUI , so I would like to connect two GPU board , one for display and the other just for processing, is there any way to use two GPU on the same PC ?
Michael Geffen
|
|
|
|
|
Hi
When I tried to run my software, I got following errors. I found that this error happened at "delete" statement.
What kind of errors it could be? Thanks.
--------------------------------------------------
HEAP[APP.exe]: Heap block at 025B7448 modified at 025B755C past requested size of 10c
Windows has triggered a breakpoint in APP.exe.
This may be due to a corruption of the heap, and indicates a bug in APP.exe or any of the DLLs it has loaded.
--------------------------------------------------
|
|
|
|
|
You allocated a memory block of size 172 bytes (one way or another). You used more than 172 bytes of that block.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
for i culminating task i have to create my own program using visual basics...i have no idea what to do.. I'm in grade 11, so something easier would be good, but not like really really simple. Does anyone have any ideas on what kind of a program i could create?
|
|
|
|
|
carleyt wrote: for i culminating task i have to create my own program using visual basics...
So wouldn't you be better served posting here?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
i wrote a c/s app. the client sends a DWORD to the server.it runs no error,but the DWORD sent doesn't equal to the DWORD received some times ,how it happens?
|
|
|
|
|
Someone ate a byte or two on the way? Seriously though, you need to be more specific than that. Read the guidelines ("How to get an answer to your question") which is on top of this forum, please.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Inputs, outputs...We have no elements, Watson!
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
maybe there is something about network byte order!
|
|
|
|
|
The network packets contain:
- packet information, which must obey the byte order specified in the standards specification; the drivers and network protocols are there to take care of that on both ends.
- the actual user-defined data (the "payload"); here it is up to the user how the bytes have to be interpreted. As the OP said it works often and fails sometimes, I don't think a byte ordering mistake was made.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Please upload you code............
|
|
|
|
|
o!! I find the problem at last! It is a Multithread problem, one data struction used in multithread without protection, data was dirty.
|
|
|
|
|
a dirty DWORD???
you mean you didn't correctly make a local copy then, it is too small to not update atomically.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
my multithread app used some threads which have a socket parameter sent in,before the parameter being used ,another thread make it dirty. this is what happened in my app.
|
|
|
|
|
Is there any way to save these files programmaticaly
Trioum
modified on Friday, June 12, 2009 2:04 AM
|
|
|
|
|
trioum wrote: We Normally save the existing file (.doc,.txt etc) by pressing the save button
What save button? In which application? Who is "We" and could you elaborate on "Normally"?
trioum wrote: Is there any way to save these files programmaticaly
Possibly. That's the best I can do with the given context.
|
|
|
|