To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
VBForums  

VB Wire News
MSDN Subscribers: Download the VS 2010 Release Candidate
MSDN Subscribers: Download the VS 2010 Release Candidate
Sell Your Code and Make Money?
Creating your own Tetris game using VB.NET
Article :: Improving Software Economics, Part 4 of 7: Top 10 Principles of Iterative Software Management



Go Back   VBForums > Visual Basic > Visual Basic FAQs

Reply Post New Thread
 
Thread Tools Search this Thread Display Modes
Old Mar 9th, 2007, 10:55 AM   #1
Hassan Basri
Hyperactive Member
 
Hassan Basri's Avatar
 
Join Date: Sep 06
Posts: 298
Hassan Basri will become famous soon enough (50+)
Modifications Required for VB6 Applications to Work on Vista

I have compiled a list of changes required for your VB6 application to work correctly on Vista. If you learn something new please post the information in this thread. Every once in awhile I will edit this first post to keep the list complete. So far this is what is known:

Application Changes
  1. Remove SendKeys calls and replace them with API code.
  2. Use the HKEY_CURRENT_USER in the registry for the settings of your application. Do not write to HKEY_LOCAL_MACHINE.
  3. If you are using ADO use 2.8 and above in your application.
  4. If you are using XML use XML version 3.0 and above in your application
  5. If you are using the PlaySound API, if your wave files are not PCM but mpeg layer-3 make sure your mpeg wave files are Stereo and not Mono.
  6. If you need the Printer Setup dialog either using the Common Dialog Control, or by using the API functions, the dialog will not return the correct number of copies. The dialog will always return 1 on Vista. The way around this bug is to create your own Printer Setup dialog box and when you get the correct number of copies you will have to send to the printer multiple times to print out multiple copies. Here is a link that discusses this issue in details.
  7. Relocate settings files, data files etc into "Common Files" (C:\Users\Public) instead of "Program Files". You should use the API calls to locate these folders because the folders are in different paths for different machines and OSs. Here is a link that discusses this issue in details.
    1. Per-user settings should be in a separate file located under "Application Data" and this should also be requested of the OS in the same manner.
    2. For "Common Files" ask for ssfCOMMONDATA (or CSIDL_COMMON_APPDATA).
    3. For "Application Data" ask for ssfAPPDATA (or CSIDL_APPDATA). To properly use these filesystem locations you are supposed to create a subdirectory for your "company name" and under that another for your "application name." Then put your settings or data under that.
    4. Any working "document" files that are meant to be found and manipulated by the user (i.e. via Explorer) should be placed into CSIDL_PERSONAL ("My Documents") or CSIDL_COMMON_DOCUMENTS ("All Users\Documents").
  8. DeleteSetting no longer works without a key. e.g. DeleteSetting "Mytestprogram, "General" fails to delete anything and gives an error. but DeleteSetting "Mytestprogram, "General","keyname" works fine. It seems that key is no longer Optional in: DeleteSetting appname, section[, key] as in documentation. Credit: roylow

Setup Package Changes

Administrator Account running your Setup Package
  1. Require users to "Run as Administrator" directly in your setup package.
  2. Inform users to right-click the setup package and click "Run As Administrator".

Non-Administrator Account running your Setup Package
  1. Remove the VB6 Runtime files, MDAC and any of these files from your setup package.

Visual Basic IDE Changes
  1. If you are using Visual Basic 6.0 on Vista, you will notice a latency in speed. This can be solved by using "Windows Classic Theme" or "Windows Vista Basic theme" instead of the new Vista Theme with the Aero effect.

Useful Links
  1. Teach Your Apps To Play Nicely With Windows Vista User Account Control
  2. Understanding and Configuring User Account Control in Windows Vista

Credits
  1. Thanks to RobDog888 for his links and knowledge on VB6 / Vista issues from several of his posts.

Last edited by Hassan Basri; Sep 5th, 2007 at 07:36 PM.
Hassan Basri is offline   Reply With Quote
Old Apr 17th, 2007, 03:08 AM   #2
RobCrombie
Fanatic Member
 
Join Date: Mar 02
Location: AUSTRALIA
Posts: 603
RobCrombie will become famous soon enough (65+)
Re: Modifications Required for VB6 Applications to Work on Vista

Thanks for the 'heads up' on SendKeys.
That's a bummer.
Here is a link on the subject -
http://forums.microsoft.com/MSDN/Sho...74685&SiteID=1
__________________
Rob C
RobCrombie is offline   Reply With Quote
Old Apr 18th, 2007, 06:45 AM   #3
Ellis Dee
PowerPoster
 
Ellis Dee's Avatar
 
Join Date: Mar 07
Location: New England
Posts: 3,015
Ellis Dee is a glorious beacon of light (400+)Ellis Dee is a glorious beacon of light (400+)Ellis Dee is a glorious beacon of light (400+)Ellis Dee is a glorious beacon of light (400+)Ellis Dee is a glorious beacon of light (400+)
Re: Modifications Required for VB6 Applications to Work on Vista

Quote:
Originally Posted by Hassan Basri
Use the HKEY_CURRENT_USER in the registry for the settings of your application.
[...]
Relocate settings files, data files etc into "Common Files" (C:\Users\Public) instead of "Program Files". You should use the API calls to locate these folders because the folders are in different paths for different machines and OSs. Here is a link that discusses this issue in details.
  1. Per-user settings should be in a separate file located under "Application Data" and this should also be requested of the OS in the same manner.
  2. For "Common Files" ask for ssfCOMMONDATA (or CSIDL_COMMON_APPDATA).
  3. For "Application Data" ask for ssfAPPDATA (or CSIDL_APPDATA). To properly use these filesystem locations you are supposed to create a subdirectory for your "company name" and under that another for your "application name." Then put your settings or data under that.
  4. Any working "document" files that are meant to be found and manipulated by the user (i.e. via Explorer) should be placed into CSIDL_PERSONAL ("My Documents") or CSIDL_COMMON_DOCUMENTS ("All Users\Documents").
How are these changes? These have been the official stated guidelines for XP development for years now.
Ellis Dee is offline   Reply With Quote
Old Apr 23rd, 2007, 09:22 AM   #4
Hassan Basri
Hyperactive Member
 
Hassan Basri's Avatar
 
Join Date: Sep 06
Posts: 298
Hassan Basri will become famous soon enough (50+)
Re: Modifications Required for VB6 Applications to Work on Vista

Quote:
Originally Posted by Ellis Dee
How are these changes? These have been the official stated guidelines for XP development for years now.
That is true but before you could get away with it, now in Vista you can't.
Hassan Basri is offline   Reply With Quote
Old May 1st, 2007, 06:41 PM   #5
NickThissen
PowerPoster
 
Join Date: Apr 07
Location: The Netherlands
Posts: 3,081
NickThissen is a glorious beacon of light (400+)NickThissen is a glorious beacon of light (400+)NickThissen is a glorious beacon of light (400+)NickThissen is a glorious beacon of light (400+)NickThissen is a glorious beacon of light (400+)NickThissen is a glorious beacon of light (400+)
Re: Modifications Required for VB6 Applications to Work on Vista

Quote:
Originally Posted by Hassan Basri
Visual Basic IDE Changes
  1. If you are using Visual Basic 6.0 on Vista, you will notice a latency in speed. This can be solved by using Windows Classic Theme instead of the new Vista Theme with the Aero effect.
I would just like to add to this, you don't have to use the Windows Classic Theme, you can also use the Windows Vista Basic theme, which still looks like Vista except for the Aero (glass) effects.
You can acces it like this:
- Rightclick on the desktop
- Choose Personalization
- Choose Windows Color and Appearance
- Choose Open Classic appearance properties for more color options
- Select Windows Vista Basic and press OK or Apply.

Just because i hate the classic windows look :P
NickThissen is offline   Reply With Quote
Old Aug 31st, 2007, 04:57 AM   #6
roylow
New Member
 
Join Date: Aug 07
Location: Australia
Posts: 1
roylow is an unknown quantity at this point (<10)
Re: Modifications Required for VB6 Applications to Work on Vista

Another incompatibility with vista (64). Deletesettings no longer works without a key.
e.g. DeleteSetting "Mytestprogram, "General" fails to delete anything and gives an error. but
DeleteSetting "Mytestprogram, "General","keyname" works fine.

It seems that key is no longer Optional in:
DeleteSetting appname, section[, key] as in documentation.
roylow is offline   Reply With Quote
Old Mar 10th, 2008, 05:37 PM   #7
TheBigB
Fanatic Member
 
TheBigB's Avatar
 
Join Date: Mar 06
Location: Debug Window Status: Bored
Posts: 892
TheBigB has a spectacular aura about (100+)TheBigB has a spectacular aura about (100+)
Re: Modifications Required for VB6 Applications to Work on Vista

Quote:
Originally Posted by NickThissen
I would just like to add to this, you don't have to use the Windows Classic Theme, you can also use the Windows Vista Basic theme, which still looks like Vista except for the Aero (glass) effects.
You can acces it like this:
- Rightclick on the desktop
- Choose Personalization
- Choose Windows Color and Appearance
- Choose Open Classic appearance properties for more color options
- Select Windows Vista Basic and press OK or Apply.

Just because i hate the classic windows look :P
Even easier;
- Go to the VB6 shortcut properties
- Go to the tab Compatibility
- Check the boxes:
- Disable visual themes
- Disable desktop composition

That's it, no need to stick to Vista Basic theme or switch around constantly.
__________________
Signatures suck...
TheBigB is offline   Reply With Quote
Old Mar 11th, 2008, 05:57 AM   #8
Czor
New Member
 
Join Date: Feb 08
Posts: 8
Czor is an unknown quantity at this point (<10)
Re: Modifications Required for VB6 Applications to Work on Vista

I changed my Vista to classic theme, and everything works fine..
Are these modifications important?
Czor is offline   Reply With Quote
Old Mar 11th, 2008, 06:28 AM   #9
NickThissen
PowerPoster
 
Join Date: Apr 07
Location: The Netherlands
Posts: 3,081
NickThissen is a glorious beacon of light (400+)NickThissen is a glorious beacon of light (400+)NickThissen is a glorious beacon of light (400+)NickThissen is a glorious beacon of light (400+)NickThissen is a glorious beacon of light (400+)NickThissen is a glorious beacon of light (400+)
Re: Modifications Required for VB6 Applications to Work on Vista

If you mean the modificiations TheBigB listed, they simply switch the theme to Vista Classic automatically as soon as VB6 is started and also switch back to your normal theme when VB6 is closed.
So it does exactly the same as manually setting the theme, only than automatically.
NickThissen is offline   Reply With Quote
Old Apr 10th, 2008, 05:48 PM   #10
koolsid
Comfortably Numb
 
koolsid's Avatar
 
Join Date: Feb 05
Location: Mumbai, India
Posts: 7,293
koolsid is a splendid one to behold (700+)koolsid is a splendid one to behold (700+)koolsid is a splendid one to behold (700+)koolsid is a splendid one to behold (700+)koolsid is a splendid one to behold (700+)koolsid is a splendid one to behold (700+)koolsid is a splendid one to behold (700+)koolsid is a splendid one to behold (700+)
Re: Modifications Required for VB6 Applications to Work on Vista

An Interesting Read

See the post by mindserve at the bottom

Hope this helps...
__________________
A good excercise for the Heart is to bend down and help another up...
Please Mark your Thread "Resolved", if the query is solved...
'~~> If a post has helped you then Please Rate it!
VB 6.0 Code Generator for VB6, Working with Windows Registry, Creating Access Database via Code
VBA 6.5
Excel Data Validation, Conditional Formating, Pivot Table, Column No to Column Name, Scroll Bars, Music Player, Creating Splash Screen
Powerpoint Creating Charts
Misc Ascii Table, Chit Chatters, USB Pendisk - Trojans
koolsid is offline   Reply With Quote
Reply

Go Back   VBForums > Visual Basic > Visual Basic FAQs


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

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -5. The time now is 11:41 AM.




To view more projects, click here

Acceptable Use Policy


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.