473,396 Members | 1,671 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Strange exception of DTE.SeletedItems.Item()

I am building a add-in project to extend the VS
environment.

Code excerpt:

EnvDTE.DTE hostApplication;
....
SelectedItems selItems = hostApplication.SelectedItems;
SelectedItem selItemObj = null;
int count = selItems.Count;
if(( count > 0)&&(!selItems.MultiSelect))
{
try
{
selItemObj = selItems.Item(1);
}
catch(Exception e)
{
string s = e.ToString();
}
...
}

Result:

For most of the projects opened or selected,the code runs
well;for quite few projects,exception catched while
calling selItems.Item(1),and s turns out to be:
"System.Runtime.InteropServices.COMException (0x80020006):
Unknown name.\r\n at ...";and once this exception
occurs,it occurs on all projects opened.

Could anybody tell me how to solve this problem?Thanks

Whyithappen

Nov 15 '05 #1
0 914

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Vishal | last post by:
Hello, I am trying to a load a RSS with some really simple code. However when I run the code I got this error: '', hexadecimal value 0x1F, is an invalid character. Line 1, position 1. ...
3
by: Jim in Arizona | last post by:
I'm going insane! I don't know if it's just that the .net 2.0 framework is buggy or if it really is my code. This is pretty hard to explain since I can't even begin to nail down why this is...
6
by: Steve Long | last post by:
Help, I'm running VS.NET 2003 and when I try to start my application, I get the "unhandled exception" dialog instead of the IDE highlighting the offending line of code. The problem appears to be...
1
by: Asko Telinen | last post by:
Hi all. I ran into quite strange problem concerning the event raising inside FileSystemWatcher Delete event. First, i would like to describe a bit my environment. I have main GUI...
0
by: Paul Cheetham | last post by:
Hi, I have a strange problem in one of my applications. It occurs after I show a second form from my main form. When I close the second form, and re-show the main form I sometimes get an...
3
by: Anup Daware | last post by:
Hi Group, I am facing a strange problem here: I am trying to read xml response from a servlet using XmlTextWriter. I am able to read the read half of the xml and suddenly an exception:...
1
by: zacks | last post by:
I am having a real strange problem. I have a relatively simple C#.NET application developed with VS2005. It is an MDI application with a single child form. In the child form, there is a Save menu...
2
by: djpaul | last post by:
Hello, I have this program and when i want to load pictures it crashes at the form.showdialog()....??? Here it goes: Private Sub CmbPath_SelectedIndexChanged(ByVal sender As Object, ByVal e As...
2
by: sirdavethebrave | last post by:
Hi guys - I have written a form, and a stored procedure to update the said form. It really is as simple as that. A user can go into the form, update some fields and hit the update button to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.