Hi,
I would like to perform some work whenever a document window is closed in
the IDE. Currently I've implemented IVsRunningDocTableEvents3, and inside
OnBeforeLastDocumentUnlock(), I do the following:
if (dwRDTLockType == (uint) _VSRDTFLAGS.RDT_EditLock && dwEditLocksRemaining
< 1)
{
// do some work via the docCookie parameter
}
This seems to be working well enough, but I wanted to know if there is a
better/safer way to handle these user events. I had originally thought to do
this work inside OnAfterDocumentWindowHide(), but I found in practice that
although this gets called at the appropriate times, its docCookie parameter
always seems to be 0, which is invalid. Hence I can't determine what file
was modified.
So, what's the best way to trap document closing events?
Thanks.
Gary Chang[MSFT] - 20 May 2005 10:11 GMT
Hi Parag,
Currently, we are looking into this problem. We will update you as soon as
we get anything out.
Thanks for your understanding!
Best regards,
Gary Chang
Microsoft Community Support
--------------------
Get Secure! ¡§C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.asp
&SD=msdn
This posting is provided "AS IS" with no warranties, and confers no rights.
Dmitry Shaporenkov - 20 May 2005 12:15 GMT
Hello Parag,
I've posted the same question to this newsgroup some time ago, but essentially
it remained without an answer.
Hopefully you'll have better luck :) Meantime I'm using the following code:
if (((_VSRDTFLAGS) dwRDTLockType & _VSRDTFLAGS.RDT_EditLock) == _VSRDTFLAGS.RDT_EditLock
&& dwEditLocksRemaining == 0)
{
//
}
So you're not alone :) But it is really weird that there is no matched 'closing'
notification to the OnBeforeDocumentWindowShow
with fFirstShow = 1.
Regards,
Dmitry Shaporenkov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
> Hi,
>
[quoted text clipped - 18 lines]
>
> Thanks.
Parag Chandra - 20 May 2005 14:33 GMT
Thanks for the tip; your version actually fixed a problem I just saw where
closing a solution would not trigger my event handler.
> Hello Parag,
>
[quoted text clipped - 40 lines]
>>
>> Thanks.