|
Hi Mark,
Tried your Suggestion, and Actually had tried that already in similar form previously some months ago, (when that did not work, desperation started to set in) It does NOT work unfortunately. I cannot send you my code for licence reasons, at the same time, I do not think that you want to wade through some 148 MByte of Source code to find the problem.
Hence I propose to write a mini DemoApp in the next few days to demonstrate the problem I'll find out a way of getting it to you, or, maybe you suggest a way how to receive it
Thanks and Regards,
LateNightsInNewry
|
|
|
|
|
A mini demo app reproducing the problem would be great
I still think the UI thread is tied up preventing paints. If the background bitmap never repaints
then something is up elsewhere.
I'll definitely take a look at it though!
Mark
"Do you know what it's like to fall in the mud and get kicked... in the head... with an iron boot?
Of course you don't, no one does. It never happens. It's a dumb question... skip it."
|
|
|
|
|
Hi Mark,
Understand all that, but it seems to be an answer to the wrong question. I am NOT trying to paint a Dialog in the middle of creation. Rather,I want to keep an Entirely Unrelated Window on the heap which acts as visual background, painted on the screen at all times. Unfortunately it gets clobbered, I try to repaint before starting something lengthy, just does not happen.
Thanks for your much appreciated comments.
Regards,
LateNightsInNewry
|
|
|
|
|
LateNightsInNewry wrote: I am NOT trying to paint a Dialog in the middle of creation. Rather,I want to keep an Entirely Unrelated Window on the heap which acts as visual background, painted on the screen at all times. Unfortunately it gets clobbered, I try to repaint before starting something lengthy, just does not happen.
Right I'm following you
All the windows on a given UI thread use the same message loop so even tieing up a child window's
creation will effect underlying parent windows messages.
In OnInitDialog() you are in the middle of handling the WM_INITDIALOG message. Until you
return from that, all the WM_PAINT (and other) messages for all the windows on the thread are
stuck in the queue.
All messages involved in redrawing the clobbered background window need to be flushed and
dispatched before entering any new lengthy operation, unless that operation is going to
periodically pump the waiting messages (and again, OnInitDialog() is a bad place for that...the
window isn't fully created and displayed yet).
Mark
"Do you know what it's like to fall in the mud and get kicked... in the head... with an iron boot?
Of course you don't, no one does. It never happens. It's a dumb question... skip it."
|
|
|
|
|
From the MFC Help Files:
Windows sends a WM_PAINT message whenever the CWnd update region is not empty and there are no other messages in the application queue for that window.
I Need the WM_PAINT Message to be sent Independent of the Message queue
LateNightsInNewry
|
|
|
|
|
BTW, from the UpdateWindow() docs:
"The function sends a WM_PAINT message directly to the window procedure of the specified window,
bypassing the application queue. If the update region is empty, no message is sent."
"Do you know what it's like to fall in the mud and get kicked... in the head... with an iron boot?
Of course you don't, no one does. It never happens. It's a dumb question... skip it."
|
|
|
|
|
Hi Mark,
Found that one too, secs after posting, but for some reason Windows does not appear to do the actual painting. See my response 3 mins ago. Suggest we return to that thread.
LateNightsInNewry
|
|
|
|
|
Hi all,
I need to create 4 MDI child windows at the start of the program for displaying 4 different pictures, please help.
regards
|
|
|
|
|
What (more specifically) is giving you trouble? When the windows are created? How the windows
are created? Are you using Doc/View architecture?
Mark
Do you know what it's like to fall in the mud and get kicked... in the head... with an iron boot?
Of course you don't, no one does. It never happens. It's a dumb question... skip it.
|
|
|
|
|
Hi Mark,
I am using Doc/View, I am just not quite familiar about the usage of CWnd::Create(), not sure where/how to use it to make 4 child windows at same time.
regards,
|
|
|
|
|
CWnd::Create won't help here. Since you are using MDI then you need to create MDI child windows
(CMDIChild) which are derived from CFrameWnd.
There's lots of ways to do this...
For pure doc/view (You have a document class, view class, and a CMultiDocTemplate associating
these) you can use the doc template and the CDocTemplate::CreateNewFrame method to create an
MDIChildWnd from a loaded document.
If you don't want to use doc/view then you can use
a) CMDIFrameWnd::CreateNewChild()
b) CFrameWnd::LoadFrame()
c) create a CMDIChildWnd (or derived) object and use CMDIChildWnd::Create() to create the Windows
object for it.
Each of these methods require different known parameters so you can choose whichever method
suits your needs.
Mark
"Do you know what it's like to fall in the mud and get kicked... in the head... with an iron boot?
Of course you don't, no one does. It never happens. It's a dumb question... skip it."
|
|
|
|
|
I checked many printing articles on CodeProject and CodeGuru
Need some help/guidance.
From my app (Environment - VC++ 6.0, MFC, Win98/2000/XP), I need to print single as well as batch of invoices and checks on dot-matrix printer
- print checks (multiple checks on single A4 page)
- print multiple invoices on one A4 or other custome size paper (e.g. 4 small-invoices on one A4 size papers)
Question is:
For dot-matrix printer, how to achieve printing such that if one invoice is printed in top 1/4 part of A4 paper, whole paper should not come out ? (User may cut printed portion of paper and aftter sometime may continue to print next invoice on same paper). (Similarly need to print one or more check)
Any sample or code snippet for such printing ?
I appreciate any help/guidance.
Anand_Arv
|
|
|
|
|
To use GDI to print then I imagine you'd need to change the paper size to a user-defined value
using the printer driver's configuration interface.
Mark
Great job, team. Head back to base for debriefing and cocktails.
|
|
|
|
|
Problem is...I need to print part of paper and then paper should not be ejected. How to achieve that ? (in an App developed with VC++/MFC and running on WinXP/Win98/Win2000)
Thanks a lot for helping.
Anand_Arv
|
|
|
|
|
I understand The problem is that to GDI, it's the paper size setting that causes the advance
to the next page when you call EndPage (or EndDoc) from your code.
If you set the paper size to 8.5 x 2.75 then it sould only advance 2.75.
Mark
"Do you know what it's like to fall in the mud and get kicked... in the head... with an iron boot?
Of course you don't, no one does. It never happens. It's a dumb question... skip it."
|
|
|
|
|
Mark Salsbery wrote: I understand The problem is that to GDI, it's the paper size setting that causes the advance
to the next page when you call EndPage (or EndDoc) from your code.
If you set the paper size to 8.5 x 2.75 then it sould only advance 2.75.
Thanks a lot for nice info.
Just curious to know...
Does this apply only to Dot Matrix Printer ?
i.e. For Laser/Inkjet printer, if I set paper size to 8.5 x 2.75 and use A4 paper, will it eject A4 paper fully or it will allow to continu printing on same paper ?
Anand
|
|
|
|
|
From my experience, a laser printer will eject the page at the end.
I'm no printing expert so I'm not sre how one can control it more precisely.
I know you could accumulate enough printing jobs to fill a sheet then do a page at a time.
Laser printers I've worked with didn't have a way to linefeed the paper and tear it off.
Maybe there's laser printers with continuous feed paper (rolls)?
I know dot matrix printers have escape codes to do it.
Mark
"Do you know what it's like to fall in the mud and get kicked... in the head... with an iron boot?
Of course you don't, no one does. It never happens. It's a dumb question... skip it."
|
|
|
|
|
An alternative method is to send escape codes directly to the printer instead of using GDI...
HOWTO: Send Raw Data to a Printer by Using the Win32 API[^]
"Do you know what it's like to fall in the mud and get kicked... in the head... with an iron boot?
Of course you don't, no one does. It never happens. It's a dumb question... skip it."
|
|
|
|
|
hello...
i am really stuck...why the spamkiller by hirosh cannot be implemented as well as i filled all the details and click on start delete? and one more thing is "error report by microsoft" always appeared.
plz..help me...why i cannot be connected..
sincerely
cheezuka
-- modified at 13:26 Monday 19th February, 2007
cheezuka
|
|
|
|
|
What in the world are you talking about? Do you have a specific VC++ question to ask?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
DavidCrow wrote: What in the world are you talking about?
Methinks this[^].
/ravi
|
|
|
|
|
Is hirosh the brother of Asok the Intern ?
|
|
|
|
|
ROTFL
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
If you have a question about an article, ask it in the forum provided for the article. If there's a lot of unanswered quesitons in that forum, chances are that the author is not suporting it, which means you need to debug it yourself, and ask specific questions here if you get stuck. If the author is not supporting the article, no way is he reading the C++ forum to answer you.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Its better you said more detaily of your problem not say it shows an error
|
|
|
|