Click here to Skip to main content
15,918,685 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: no border for my form Pin
zon_cpp22-Nov-08 1:45
zon_cpp22-Nov-08 1:45 
GeneralRe: no border for my form Pin
Randor 22-Nov-08 2:50
professional Randor 22-Nov-08 2:50 
QuestionContinuesPrinting not working please help me. Pin
Le@rner21-Nov-08 18:17
Le@rner21-Nov-08 18:17 
AnswerRe: ContinuesPrinting not working please help me. Pin
Rajesh Katalkar24-Nov-08 4:54
Rajesh Katalkar24-Nov-08 4:54 
QuestionProblem in debugging [modified] Pin
sen pao21-Nov-08 17:11
sen pao21-Nov-08 17:11 
AnswerRe: Problem in debugging Pin
David Crow21-Nov-08 18:04
David Crow21-Nov-08 18:04 
AnswerRe: Problem in debugging Pin
sen pao21-Nov-08 18:17
sen pao21-Nov-08 18:17 
AnswerNeed Help: How do I assign a Char* To System::String ^ Pin
niiAmoo21-Nov-08 12:35
niiAmoo21-Nov-08 12:35 
GeneralRe: Need Help: How do I assign a Char* To System::String ^ Pin
Saurabh.Garg21-Nov-08 16:43
Saurabh.Garg21-Nov-08 16:43 
GeneralRe: Need Help: How do I assign a Char* To System::String ^ Pin
niiAmoo21-Nov-08 20:47
niiAmoo21-Nov-08 20:47 
GeneralRe: Need Help: How do I assign a Char* To System::String ^ Pin
Saurabh.Garg22-Nov-08 3:16
Saurabh.Garg22-Nov-08 3:16 
QuestionApp depending on wrong DLL version Pin
KellyR21-Nov-08 10:45
KellyR21-Nov-08 10:45 
AnswerRe: App depending on wrong DLL version Pin
Randor 22-Nov-08 0:26
professional Randor 22-Nov-08 0:26 
QuestionSerialization and schema numbers Pin
softwaremonkey21-Nov-08 5:41
softwaremonkey21-Nov-08 5:41 
QuestionRe: Serialization and schema numbers Pin
Mark Salsbery21-Nov-08 6:13
Mark Salsbery21-Nov-08 6:13 
QuestionAVI frame grabber – needs timer, why? [modified] SOLVED Pin
Vaclav_21-Nov-08 5:08
Vaclav_21-Nov-08 5:08 
AnswerRe: AVI frame grabber – needs timer, why? Pin
Mark Salsbery21-Nov-08 6:54
Mark Salsbery21-Nov-08 6:54 
GeneralRe: AVI frame grabber – needs timer, why? Pin
Vaclav_23-Nov-08 5:48
Vaclav_23-Nov-08 5:48 
QuestionUser-defined objects in Windows message parameters Pin
Atropus21-Nov-08 3:50
Atropus21-Nov-08 3:50 
AnswerRe: User-defined objects in Windows message parameters Pin
Matthew Faithfull21-Nov-08 4:00
Matthew Faithfull21-Nov-08 4:00 
AnswerRe: User-defined objects in Windows message parameters Pin
Rajasekharan Vengalil21-Nov-08 5:31
Rajasekharan Vengalil21-Nov-08 5:31 
AnswerRe: User-defined objects in Windows message parameters Pin
Roger Stoltz21-Nov-08 5:56
Roger Stoltz21-Nov-08 5:56 
Ummm, I don't see what the problem is.... Confused | :confused:
You don't say anything about what you've tried so far and how it fails, it looks to be more of a design question...


Atropus wrote:
I've made a working thread that interact with a window by user-defined messages (WM_USER + x)


Quite all right, as long as you use PostMessage() and not SendMessage() to avoid a deadlock situation. But you should not use WM_USER; at least use WM_APP.
What you really should do is use registered messages.
Read this[^].


Atropus wrote:
I would like use WPARAM and/or LPARAM to give to the window objects allocated in the working thread.


This should in most cases be fine as well, depending on what type of object you're allocating. Read the article linked to above.
It could be dangerous if it's an MFC object since MFC classes wraps objects like e.g. windows and sockets that are referred to through a handle and the MFC object handle map is on per thread basis.
But if it really is an MFC object your trying to pass you should re-evaluate your design because you'll get into troubles sooner or later.


Atropus wrote:
I know that the object I want pass through the message must be deallocated and I've tried to use the SendMessageCallback function


Deallocate the object in the message handler.
The only danger you'll expose yourself to is a memory leak if the message for some reason should not be handled. But if that happens the memory leak would be the least of your problems.


You should really read this article[^] before continuing with your worker thread.
It's the best introduction to worker threads I've come across.


"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"High speed never compensates for wrong direction!" - unknown


QuestionSimple CFileDialog Question Pin
sabdalla8021-Nov-08 2:59
sabdalla8021-Nov-08 2:59 
QuestionRe: Simple CFileDialog Question Pin
David Crow21-Nov-08 3:05
David Crow21-Nov-08 3:05 
AnswerRe: Simple CFileDialog Question Pin
sabdalla8021-Nov-08 3:32
sabdalla8021-Nov-08 3:32 

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.