Re: WTL, GUI and Thread

Mark Grandau <[email protected]>
Newsgroups gmane.comp.windows.wtl
Message-ID <[email protected]>
Thats why I said you need to make sure the memory for the string doesn't go
away.


You can preallocate a buffer.
Pass it in with the handle to the init of the worker thread.
Write your string to that buffer.
Pass that buffer address lparam.

On shutdown after the worker thread is done. The gui thread who is the owner
of the buffer can destroy  it.



If all you're looking for is a simple one way method to pass info out of the
worker thread that works.

If you're looking for something more make a custom message that takes a
CComBSTR. Use reference counting to determine when the buffer is destroyed.
Thats exactly how COM interfaces pass strings.


[Non-text portions of this message have been removed]



------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/wtl/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/wtl/join
    (Yahoo! ID required)

<*> To change settings via email:
    [email protected] 
    [email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.