Click here to Skip to main content
15,886,873 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: texture2D stretch Pin
boxfile26-Jul-13 16:40
boxfile26-Jul-13 16:40 
Questionhook game for d3d10 or d3d11 Pin
boxfile18-Jul-13 16:36
boxfile18-Jul-13 16:36 
AnswerRe: hook game for d3d10 or d3d11 Pin
boxfile18-Jul-13 19:47
boxfile18-Jul-13 19:47 
QuestionCalling GUI functions from a worker thread in MFC?? Pin
Kiran Satish18-Jul-13 9:25
Kiran Satish18-Jul-13 9:25 
AnswerRe: Calling GUI functions from a worker thread in MFC?? Pin
pasztorpisti18-Jul-13 11:39
pasztorpisti18-Jul-13 11:39 
GeneralRe: Calling GUI functions from a worker thread in MFC?? Pin
«_Superman_»18-Jul-13 21:25
professional«_Superman_»18-Jul-13 21:25 
GeneralRe: Calling GUI functions from a worker thread in MFC?? Pin
pasztorpisti18-Jul-13 22:56
pasztorpisti18-Jul-13 22:56 
GeneralRe: Calling GUI functions from a worker thread in MFC?? Pin
Kiran Satish19-Jul-13 10:46
Kiran Satish19-Jul-13 10:46 
Thanks for your reply. Probably I should show how I am currently defining my thread and how I am using it.

Declaration:
C++
static	DWORD WINAPI ThreadProcess(LPVOID pParam);


Definition:
C++
DWORD WINAPI CMainDoc::ThreadProcess(LPVOID pParam)
{
	CMainDoc *parent = (CMainDoc *)pParam;

	while(TRUE) {
		switch(::WaitForSingleObject(2, parent->m_eMsg, FALSE, INFINITE)) {//Process the message
		case WAIT_OBJECT_0:
//access some variables in the document using parent pointer and update them such as parent->var1, parent->var2 etc.
			parent->UpdateAllViews(NULL);
			break;
		case WAIT_OBJECT_1://process close msg		
			pObject->PostMessage(WM_CLOSE, 0, 0);
				break;
}
}

Now if I do the way you suggested, do I need to send the handle returned from AfxGetMainWnd() along with a pointer to the document in 'pParam'?
PKNT

GeneralRe: Calling GUI functions from a worker thread in MFC?? Pin
pasztorpisti19-Jul-13 14:01
pasztorpisti19-Jul-13 14:01 
GeneralRe: Calling GUI functions from a worker thread in MFC?? Pin
Kiran Satish19-Jul-13 16:18
Kiran Satish19-Jul-13 16:18 
GeneralRe: Calling GUI functions from a worker thread in MFC?? Pin
pasztorpisti20-Jul-13 6:07
pasztorpisti20-Jul-13 6:07 
AnswerRe: Calling GUI functions from a worker thread in MFC?? Pin
David Crow19-Jul-13 4:43
David Crow19-Jul-13 4:43 
AnswerRe: Calling GUI functions from a worker thread in MFC?? Pin
Erudite_Eric22-Jul-13 4:59
Erudite_Eric22-Jul-13 4:59 
GeneralRe: Calling GUI functions from a worker thread in MFC?? Pin
Kiran Satish22-Jul-13 5:23
Kiran Satish22-Jul-13 5:23 
QuestionHow to disable copy/paste in CEdit? Pin
Donguy197617-Jul-13 5:53
Donguy197617-Jul-13 5:53 
AnswerRe: How to disable copy/paste in CEdit? Pin
NotPolitcallyCorrect17-Jul-13 6:05
NotPolitcallyCorrect17-Jul-13 6:05 
GeneralRe: How to disable copy/paste in CEdit? Pin
Erudite_Eric17-Jul-13 23:30
Erudite_Eric17-Jul-13 23:30 
GeneralRe: How to disable copy/paste in CEdit? Pin
NotPolitcallyCorrect18-Jul-13 1:40
NotPolitcallyCorrect18-Jul-13 1:40 
AnswerRe: How to disable copy/paste in CEdit? Pin
Erudite_Eric17-Jul-13 23:33
Erudite_Eric17-Jul-13 23:33 
Questionofstream optimization problem Pin
doug2517-Jul-13 4:43
doug2517-Jul-13 4:43 
AnswerRe: ofstream optimization problem Pin
Richard MacCutchan17-Jul-13 4:53
mveRichard MacCutchan17-Jul-13 4:53 
GeneralRe: ofstream optimization problem Pin
doug2517-Jul-13 5:06
doug2517-Jul-13 5:06 
GeneralRe: ofstream optimization problem Pin
Richard MacCutchan17-Jul-13 5:22
mveRichard MacCutchan17-Jul-13 5:22 
GeneralRe: ofstream optimization problem Pin
doug2517-Jul-13 5:48
doug2517-Jul-13 5:48 
GeneralRe: ofstream optimization problem Pin
Richard MacCutchan17-Jul-13 7:12
mveRichard MacCutchan17-Jul-13 7:12 

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.