Overclock.net - Overclocking.net
     
 
Home Gallery Reviews Blogs Register Today's Posts Mark Forums Read Members List


Go Back   Overclock.net - Overclocking.net > Software, Programming and Coding > Coding and Programming

Reply
 
LinkBack Thread Tools
Old 06-24-08   #1 (permalink)
New to Overclock.net
 
Join Date: May 2008
Location: Nottingham, UK
Posts: 24

Rep: 7 Stormwolf Unknown
Unique Rep: 0
Trader Rating: 0
Default VB Help (Hitting Limits of Listbox)

I've been tasked with updating a VB6 app that was written by someone else a couple of years ago. The purpose of the application is to produce a 'diff' report on a hierarchical object model (as a CASE tool plug in).

My problem is that the difference between the models have now grown to a magnitude where the number of items reported now exceeds the limits of the VB Listbox (given that if you try to contain more than 32767 items the Listbox.ListCount property returns a negative number and screws up a number of further operations).

Given that I'm not a VB programmer (I've spent years avoiding anything with a GUI) and my manager isn't prepared to allow the time to rewrite the whole application, what strategies would you suggest for dealing with the issue?

So far I have:
  • Cap the list at 32767 entries. Further changes are lost
  • Divide up the list results into a variable number of 'list pages'
  • Split the results into 'adds, deletes and changes and display each in a separate list (this might still hit cap issues in some situations)


I'm not sure that a tree view is a good idea for performance reasons given the size of the dataset. Any more suggestions on what to do with this apart from curse Microsoft for not thinking beyond the limits of a 16-bit integer?

NB Any suggestions need to be VB6-compatible (unfortunately)
Stormwolf is offline   Reply With Quote
Old 06-24-08   #2 (permalink)
Intel Overclocker
 
h33b's Avatar
 
intel nvidia

Join Date: Feb 2008
Location: $Texas
Posts: 1,256

Rep: 138 h33b is acknowledged by manyh33b is acknowledged by many
Unique Rep: 0
Folding Team Rank: 185
Team Name: Lone Folders
Trader Rating: 12
Default

Although I have only just started taking courses in VB, I have to ask which version of Visual Studio are you using? I've never had that many list box items, but it seems like it might be a limitation in an earlier version of the studio. I know that in class we had incompatibilities in editing between the 2003? and 2008 versions, though through compiling issues were removed.

Just my .02
__________________
My lapped q6600 and Tuniq Tower
Folding for OCN
Quote:
Originally Posted by pioneerisloud View Post
And NEVER go AS5 to mouth!
Killed my first motherboard due to overclock on 5/17/08 - I'll miss you P5N-E SLI

System: Monster Mash
CPU
C2Q Q6600 G0 @ 3.4 (lapped)
Motherboard
Asus p5k Deluxe Wifi
Memory
4x1GB OCZ SLI PC8500
Graphics Card
Asus 8800GTX 768MB
Hard Drive
WD 250GB x2 Raid 0; WD 640AAKS
Sound Card
X-Fi Xtreme Music + Front Panel
Power Supply
OCZ Xtreme 700W
Case
Antec P182
CPU cooling
Tuniq Tower 120 (lapped)
GPU cooling
HR-03 Plus
OS
Vista Ultimate x64
Monitor
Sceptre x22wg-Gamer
h33b is offline I fold for Overclock.net   Reply With Quote
Old 06-24-08   #3 (permalink)
New to Overclock.net
 
Join Date: May 2008
Location: Nottingham, UK
Posts: 24

Rep: 7 Stormwolf Unknown
Unique Rep: 0
Trader Rating: 0
Default

As I said, it's Visual Basic 6. Unfortunately. I'm restricted in what I can use here for various reasons... VB.NET (i.e. Visual Studio 2003, 2005, or 2008) solutions are not an option

Nice sig pic btw
Stormwolf is offline   Reply With Quote
Old 06-24-08   #4 (permalink)
Performance...
 
linskingdom's Avatar
 
intel nvidia

Join Date: Jun 2007
Location: In Office
Posts: 9,260

Rep: 2322 linskingdom is a legendlinskingdom is a legendlinskingdom is a legendlinskingdom is a legendlinskingdom is a legendlinskingdom is a legendlinskingdom is a legendlinskingdom is a legendlinskingdom is a legendlinskingdom is a legendlinskingdom is a legend
Unique Rep: 1
Trader Rating: 4
Default

Technically, you can add more than 32767 items (int16) to the listbox but just can’t access the items beyond 32767. To work around this, if you can, you can use control such as listveiw to take advantage of 16bit Long data type but the appreance is different than listbox.

System: QD65D45
CPU
65Q/D&45D
Motherboard
DFI/Asus/Gigabyte
linskingdom is offline Overclocked Account linskingdom's Gallery   Reply With Quote
Old 06-24-08   #5 (permalink)
***Nvidia FTW***
 
The_Rocker's Avatar
 
intel nvidia

Join Date: Jul 2007
Location: England
Posts: 5,539

Rep: 304 The_Rocker is a proven memberThe_Rocker is a proven memberThe_Rocker is a proven memberThe_Rocker is a proven member
Unique Rep: 0
Trader Rating: -1
Default

After you have reached 32767 items, store the whole range of data in a variable or even write to a file if you must. Then recall the information into the listbox control source.

This way you could have multiple "sets" of data and call each one up when needed.

The only problem here is that you may as well be rebuilding the entire app and in that case you may as well use 16bit controls and data types to store the information.
__________________
System: -=The DiSeMbOwLeR v1.5=-
CPU
E8600 (Q822A438) @ 4.33Ghz (433 x 10 - 1.328v)
Motherboard
eVGA 780i A1 (P07 BIOS - V Droop modded)
Memory
2 x 2GB G.Skill PK @ 1066Mhz 5-5-5-15 2T
Graphics Card
2 x Zotac GTX280 AMP Edition's in SLI (700c/2300m)
Hard Drive
2 x Western Digital 500GB AAKS's in RAID 0
Sound Card
Auzentech X-Fi Prelude (Optical DTS> Z-5500's)
Power Supply
Tagan 900w BZ Modular Piperock (Turbo Mode)
Case
Antec 1200 Ultimate Gamers case
CPU cooling
Lapped TRUE 120 & OCZ 120mm Fan
GPU cooling
Nvidia GTX280 Reference coolers.
OS
Vista Ultimate x64 SP1
Monitor
20" Samsung Syncmaster 2032BW (1680 * 1050)
The_Rocker is offline Overclocked Account   Reply With Quote
Old 06-24-08   #6 (permalink)
New to Overclock.net
 
Join Date: May 2008
Location: Nottingham, UK
Posts: 24

Rep: 7 Stormwolf Unknown
Unique Rep: 0
Trader Rating: 0
Default

Quote:
Originally Posted by linskingdom View Post
Technically, you can add more than 32767 items (int16) to the listbox but just can’t access the items beyond 32767. To work around this, if you can, you can use control such as listveiw to take advantage of 16bit Long data type but the appreance is different than listbox.
I know you can add more than 32767 entries (because that's what I did without any VB complaining at all As you say, the issue comes out when you actually try to display beyond the limit. The scroll bar also caps out at 32767) and (as far as I can work out) the Listview also has a limit of 32767 entries.

The results are already in an internal data structure (effectively a paired array parsed directly from the CASE tool model) - the original problem was that the guy who implemented the tool used static arrays, which caused the tool to fall over when you exceeded the array limit. I fixed this problem, only to reveal the UI issue.

I think I'll probably go for the page's approach (effectively a 'window on the list' and display a couple of hundred at a time, with maybe a filter on top to further limit the display to items of interest.
Stormwolf is offline   Reply With Quote
Old 06-24-08   #7 (permalink)
Performance...
 
linskingdom's Avatar
 
intel nvidia

Join Date: Jun 2007
Location: In Office
Posts: 9,260

Rep: 2322 linskingdom is a legendlinskingdom is a legendlinskingdom is a legendlinskingdom is a legendlinskingdom is a legendlinskingdom is a legendlinskingdom is a legendlinskingdom is a legendlinskingdom is a legendlinskingdom is a legendlinskingdom is a legend
Unique Rep: 1
Trader Rating: 4
Default

Quote:
Originally Posted by Stormwolf View Post
I know you can add more than 32767 entries (because that's what I did without any VB complaining at all As you say, the issue comes out when you actually try to display beyond the limit. The scroll bar also caps out at 32767) and (as far as I can work out) the Listview also has a limit of 32767 entries.

The results are already in an internal data structure (effectively a paired array parsed directly from the CASE tool model) - the original problem was that the guy who implemented the tool used static arrays, which caused the tool to fall over when you exceeded the array limit. I fixed this problem, only to reveal the UI issue.

I think I'll probably go for the page's approach (effectively a 'window on the list' and display a couple of hundred at a time, with maybe a filter on top to further limit the display to items of interest.
The page's approach is a good solution. It works much better and may speed up the whole thing. Also, to use offline ADO data storage is another work around. Good luck.

System: QD65D45
CPU
65Q/D&45D
Motherboard
DFI/Asus/Gigabyte
linskingdom is offline Overclocked Account linskingdom's Gallery   Reply With Quote
Old 06-24-08   #8 (permalink)
New to Overclock.net
 
Join Date: May 2008
Location: Nottingham, UK
Posts: 24

Rep: 7 Stormwolf Unknown
Unique Rep: 0
Trader Rating: 0
Default

Quote:
Originally Posted by linskingdom View Post
The page's approach is a good solution. It works much better and may speed up the whole thing. Also, to use offline ADO data storage is another work around. Good luck.
It'll certainly speed up the report generation stage which currently gives a good impression of a hung app ADO data storage is beyond the scope of this app, which is really just a difference reporting tool. The models are already stored in their own database.
Stormwolf is offline   Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools



All times are GMT -4. The time now is 11:17 AM.


Overclock.net is a Carbon Neutral Site Creative Commons License Internet Security By ControlScan

Terms of Service / Forum Rules | Privacy Policy | Advertising | Become an Official Vendor
Copyright © 2008 Shogun Interactive Development. Most rights reserved.
Page generated in 0.18735 seconds with 9 queries