Advertisement
4_2005-2006 Complete Applications #167910

RAM Inspector 2.0 with novel vertical meters made from panels and advice on upgrading VB6 code

I've been going through my collection of VB6 code downloaded from PSC. Since I'm coding exclusively in Visual Basic 2005 now, I was able to immediately cull out a lot of code. I don't need users controls to provide the "XP Look," for instance. And other code just duplicates functions built into the .NET Framework. After that I was left will quite a few programs that looked interesting. I've done about 20 of these conversion so far, but none that I spent as much time on as this one. These conversions can take a long time, so you should carefully examine the VB6 code first. If you haven't downloaded the NEW version of the Visual Basic Code Advisor from Microsoft, do yourself a favor and do so. It's much better than the old one. You can also set what your target development environment will be. It's also useful for cleaning up code that you intend to leave in VB6. You should also look at the code you intend to convert. If you don't see "Option Explicit" or "Dim" statements, the code is probably full of variants and is probably not worth fooling with. If you see any undocumented statements like "VarPtr," forget it. If the code is messy and all the variable names are like "Text1" and "Command1," you should take the time to give all the controls and variables meaningful names. And you should format the code. Fix everything you can while in VB6! This particular project had some bad formatting, default contol names, and a few strange programming practices like storing integers as strings in hidden text boxes and then converting them back for use! It also had a user control that provided meters or vertical bars for memory usage. I looked at it and decided I would have to come up with another solution because the user control used the "Shape" control which does not exist in VB.NET. I just replaced the "meters" with picture boxes as placeholders and decided I would come up with a solution. Also the project used the API call GlobalMemoryStatus, which is obsolete because it will not deal with RAM or Page Files larger than 4 GB. I also decided to replace that after the conversion. I came up with what I think is a novel replacement for the "meters." I used several panels per "meter," a little arithmetic, and a timer control. Maybe you might find this idea useful.

AI

AI Summary: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Source Code
original-source
Upload
Upload
Original Comments (3)
Recovered from Wayback Machine