Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / Extensibility / May 2005

Tip: Looking for answers? Try searching our database.

Best way to trap document closing events?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Parag Chandra - 19 May 2005 22:29 GMT
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.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.