I am desperate for help! This is really eating my breakfast, lunch and dinner!
I have a class I have derived from the native ListView class. I have a context menu that I show when the user right clicks on a selected item in the list. When they select the "Delete" option in the context menu, I do a ListView.RemoveAt(index) where index is the index of the item they selected. The remove at works, but when the method returns control to the operating system, I get an unhandled exception with the following exception text.
************** Exception Text **************
System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: '0' is not a valid value for 'displayIndex'.
at System.Windows.Forms.ListViewItemCollection.get_Item(Int32 displayIndex)
at System.Windows.Forms.ListView.LvnBeginDrag(MouseButtons buttons, NMLISTVIEW nmlv)
at System.Windows.Forms.ListView.WmReflectNotify(Message& m)
at System.Windows.Forms.ListView.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
I can find no place in the remainder of my code where I am trying to attempt to access an item from the listview. Can anyone help decipher what my problem is?
Principal IT Analyst
I miss how I could look at just the header file to see all the class methods. Yes, sometimes there was a lot of inline "clutter", but for the most part, I could get a "at a glance" concept of the class.
Yes, there's the outlining capability, but I find it annoying to use. Lots of mouse clicks, it would be nice if I could set it to always collapse when I load file, etc. Yes, there's the XML documentation capability, but that's if I or someone who wrote the class actually documented the functions in that way (of course, we all should!)
What was the rational behind separating definition from implementation?
Thanks for the info! I never used the ClassView in VC6, so I totally forgot about that feature. On further investigation, I also noted that the object browser displays the XML comment tags for the different types.
You can set it to collapse when you open the file...can't remember where it was cause I'm on my Mom's computer right now...but I'll look for it later this afternoon.
Norm Almond: I seen some GUI's in my life but WTF is this mess Leppie: I made an app for my sister and she wouldnt use it till it was colorful enough Norm:good point leppie, from that statement I can only deduce that this GUI must be aimed at children Leppie:My sister is 25
-Norm on the MailMagic GUI
I am trying to write a program that sends data from a DataTable to an Microsoft Access Database (mdb format) using an OleDBConnection. The regional settings of my computer are set to "Greek". The problem is that the decimal numbers stored in the datatable cannot be transferred correctly to the Access Database. For example, the numer 15.34 (where "." is the decimal point for the US Regional Settings) is stored as 15.340,00 (where "," is the decimal point for the Greek Regional Settings).
I have tried to set the regional settings from inside the source code (using the CurrentThread.CultureInfo to "Greek") but that only applies to System.String values, and NOT decimal or floating point. For this reason, the values cannot be stored correctly into the Access DB file. The only way to correct this problem is to manually change the regional settings from the Control Panel, but I would like to avoid this solution.
I would appreciate it if you could help me with this issue.
I had a similar problem some weeks ago using MSDE. I was storing dates using DateTime.ToLongDateString() and DateTime.ToShortTimeString(), but I found out that it generated an exception on systems where Windows was localized to Spanish (dates in Mexico are DD/MM/YYYY as oppossed to MM/DD/YYYY).
What I did was to manually construct the date string using DateTime properties (Month, Day and so on) and it worked well on both my English development machine and those in Spanish where it was tested.