|
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.
|
|
|
|
|
ok process from another programme
Trioum
modified on Friday, June 12, 2009 2:10 AM
|
|
|
|
|
trioum wrote: by pressing the save button
OK, I just spotted the thread where you asked the same question:
http://www.codeproject.com/Messages/3053288/saving-file.aspx[^]
The save button you refer to appears to be some mystical entity or is possibly located in a parallel universe (or both?) since you are unable to tell us more about it.
|
|
|
|
|
tell me one thing what will you do if save the content
Trioum
modified on Friday, June 12, 2009 2:16 AM
|
|
|
|
|
|
I think what he's looking for is a way to send the correct message or key value to another program to make it save the current file, something which has been covered here many times, and which Google will give an answer to in about 5 ms.
There are three kinds of people in the world - those who can count and those who can't...
|
|
|
|
|
Why the hell are you posting all this rubbish in the Visual C++ forum? Can't you just see what kind of lame posts are you making?!
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Word provides a menu item for this or am I wrong?
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]
|
|
|
|
|
The level of dross questions have increased many fold these days.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|