Click here to Skip to main content
16,010,351 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: reading and writing to a file outside of my programming Pin
Navin11-Jun-04 8:02
Navin11-Jun-04 8:02 
Generalsending messages within an application. Pin
Anonymous11-Jun-04 5:39
Anonymous11-Jun-04 5:39 
GeneralRe: sending messages within an application. Pin
David Crow11-Jun-04 6:31
David Crow11-Jun-04 6:31 
GeneralRe: sending messages within an application. Pin
Anonymous11-Jun-04 7:20
Anonymous11-Jun-04 7:20 
GeneralRe: sending messages within an application. Pin
Anonymous11-Jun-04 7:30
Anonymous11-Jun-04 7:30 
GeneralRe: sending messages within an application. Pin
Anonymous11-Jun-04 7:48
Anonymous11-Jun-04 7:48 
GeneralRe: sending messages within an application. Pin
David Crow11-Jun-04 8:00
David Crow11-Jun-04 8:00 
GeneralRe: sending messages within an application. Pin
Anonymous11-Jun-04 8:32
Anonymous11-Jun-04 8:32 
But isn't it for sending messages between applications?
I already used it which is catching Messages from Printer without really knowing it.
How am I going to let my application stop and wait for the message to coming in.. actually application is just talking to itself.

I got confused, let me clearify and see I'm right.
1) create the thread using AfxThreadBegin() when Print button is clicked. So entire GUI is still alive and user can still click on either Stop or Exit button.

2)Print the file, and wait for the message from printer. Now I'm using global bool variables stopPrinting and printNextfile to stop.
<br />
UINT theThread(...)<br />
{<br />
while(!stopPrinting) <br />
{<br />
 if(printNextfile)<br />
 PrintNextFile();<br />
else if(stopPrinting)<br />
break;<br />
 }<br />
}<br />

it is working fine. the program is doing what I want it to do but I dont' really like it coz it takes so much of CPU time. and Dont' really know to improve it

The solution I guess was take out while loop and why dont'I just respond to message. but how to?
Using RegisterWindowMessage and SendMessage() functions will help?

if(END_DOC)
SendMessage(PRINT_NEXT_FILE);

OnPrintNextFile()
{
printNextfile();
}

So how am I going to stop or respond to Stop Button was clicked?

thanks
GeneralRe: sending messages within an application. Pin
David Crow11-Jun-04 8:40
David Crow11-Jun-04 8:40 
GeneralRe: sending messages within an application. Pin
Anonymous11-Jun-04 8:57
Anonymous11-Jun-04 8:57 
GeneralRe: sending messages within an application. Pin
David Crow11-Jun-04 9:36
David Crow11-Jun-04 9:36 
GeneralRe: sending messages within an application. Pin
Anonymous14-Jun-04 3:51
Anonymous14-Jun-04 3:51 
GeneralPassing cdc across threads Pin
Member 51425211-Jun-04 5:35
Member 51425211-Jun-04 5:35 
GeneralRe: Passing cdc across threads Pin
palbano11-Jun-04 5:41
palbano11-Jun-04 5:41 
GeneralRe: Passing cdc across threads Pin
suiram4011-Jun-04 7:48
suiram4011-Jun-04 7:48 
GeneralRe: Passing cdc across threads Pin
Anonymous11-Jun-04 23:57
Anonymous11-Jun-04 23:57 
GeneralRe: Passing cdc across threads Pin
Member 51425212-Jun-04 0:00
Member 51425212-Jun-04 0:00 
Questionhow do i load a dll made in C#? Pin
FASTian11-Jun-04 5:17
FASTian11-Jun-04 5:17 
AnswerRe: how do i load a dll made in C#? Pin
Alexander M.,11-Jun-04 5:43
Alexander M.,11-Jun-04 5:43 
GeneralRe: how do i load a dll made in C#? Pin
palbano11-Jun-04 6:47
palbano11-Jun-04 6:47 
AnswerRe: how do i load a dll made in C#? Pin
Andy Brummer11-Jun-04 9:25
sitebuilderAndy Brummer11-Jun-04 9:25 
AnswerRe: how do i load a dll made in C#? Pin
krisko11-Jun-04 9:59
krisko11-Jun-04 9:59 
AnswerRe: how do i load a dll made in C#? Pin
Joel Lucsy12-Jun-04 14:12
Joel Lucsy12-Jun-04 14:12 
GeneralHelp Wanted to display dlg box frm the Service Pin
ThatsAlok11-Jun-04 5:16
ThatsAlok11-Jun-04 5:16 
GeneralRe: Help Wanted to display dlg box frm the Service Pin
David Crow11-Jun-04 5:17
David Crow11-Jun-04 5: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.