winzip icon

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

Email
Submitted on: 1/4/2015 4:11:00 AM
By: Herbert N Swearengen III (from psc cd)  
Level: Intermediate
User Rating: By 6 Users
Compatibility: VB.NET
Views: 1305
 
     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.

 
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
//**************************************
// for :RAM Inspector 2.0 with novel vertical meters made from panels and advice on upgrading VB6 code
//**************************************
This code is copyrighted but maybe freely distributed and modified for any purpose as long as the original copyright is retained.
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com


Other 21 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments


 There are no comments on this submission.
 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.