Board index » Visual Studio » How to get the active document
|
Aryan
|
|
Aryan
|
How to get the active document
Visual Studio190
Hi. How can I get the active document object (to clarify, the document object associated with the view that has focus) in an MDI application? I'm using a worker thread for communication and I need to tell the active document about communication event that occur. Thanks, Isaac. - |
| Ajay
Registered User |
Thu Jul 10 12:50:13 CDT 2003
Re:How to get the active document
You can get the active document in MDI using GetActiveFrame(), checking its
validity and then calling GetActiveDocument on it. The only catch here is that you are doing it in a worker thread. I think it should work there as well because you are not using the (CWnd,handle) map of MFC that is not valid in your thread. In worst case, you can pass the document pointer to the thread at the beginning. -- Ajay Kalra [MVP - VC++] ajaykalra@yahoo.com "Isaac Raway" <isaac@blueapples.org>wrote in message QuoteHi. How can I get the active document object (to clarify, the document - |
