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

C / C++ / MFC

 
GeneralRe: Microsoft !!! Q's Pin
jj3pa11-Jun-04 14:21
jj3pa11-Jun-04 14:21 
GeneralRe: Microsoft !!! Q's Pin
toxcct13-Jun-04 3:28
toxcct13-Jun-04 3:28 
Generalreading and writing to a file outside of my programming Pin
kyleiscool200411-Jun-04 6:40
kyleiscool200411-Jun-04 6:40 
GeneralRe: reading and writing to a file outside of my programming Pin
jmkhael11-Jun-04 6:47
jmkhael11-Jun-04 6:47 
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 
Thannk you David for answering my question in detail.
I'm new in sending message and reading it.
I only have one dlg ( window). I think I should give you more detail about my program.

My program is dialog based program, which has 3 buttons, print, stop, and exit on it.
When user clicked on print, the thread gets created. the thread is keeping checking whether the global boolean variable stopPrinting = true. ( stopPrinting is set to TRUE when the user clicked on Stop button)
<br />
UINT PrintingThreadFunction(LPVOID lParam)<br />
{<br />
myApp *dlg = (myApp*)lParam;<br />
while(!stopPrinting) <br />
{<br />
dlg->printafile();<br />
}<br />
}<br />


the file sent to the printer and printer send the message "END_DOC" to application back. To catch the message sent from printer, I used RegisterWindowMessage() first and add the following code to messgae map
BEGIN_MESSAGE_MAP(CSMPClientDlg, CDialog)<br />
	ON_WM_SYSCOMMAND()<br />
	ON_WM_PAINT()<br />
	ON_WM_QUERYDRAGICON()<br />
	//}}AFX_MSG_MAP		<br />
	ON_BN_CLICKED(IDC_PRINT, OnBnClickedPrint)<br />
	ON_BN_CLICKED(IDCANCEL, OnBnClickedCancel)<br />
	ON_BN_CLICKED(IDC_STOP_PRINT, OnBnClickedStopPrint)<br />
<font color = green>	ON_REGISTERED_MESSAGE(BlackIcePrintMessage,OnPrinterMsg)</font><br />
END_MESSAGE_MAP()


I want my applicaton to just listen to or waiting for the message from printer to comes and do nothing. Then when the application got the message END_DOC, send the message, PRINT_NEXT_FILE or wake application up so it can move on next one. At the same time, if the user clicked on Stop button, application should drop whatever its doing.

LRESULT myApp::OnPrinterMsg(WPARAM wParam, LPARAM lParam )
{
...
..
if(wParam == END_DOC)
//send the message PRINT_NEXT_FILE
}


thank you
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 
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 

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.