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
Part 10 of the Visual Basic .NET 2010 Express Tutorial Complete!
How to Use the Visual Studio Code Analysis Tool FxCop
Article :: Interview with Andrei Alexandrescu (Part 3 of 3)
Introducing Visual Studio LightSwitch
Visual Studio LightSwitch Beta 1 is Available



Go Back   VBForums > Visual Basic > Visual Basic FAQs

Reply Post New Thread
 
Thread Tools Display Modes
Old Mar 9th, 2007, 09: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/7

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 06:36 PM.
Hassan Basri is offline   Reply With Quote
Old Apr 17th, 2007, 02: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, 05:45 AM   #3
Ellis Dee
PowerPoster
 
Ellis Dee's Avatar
 
Join Date: Mar 07
Location: New England
Posts: 3,255
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+)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, 08: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, 05:41 PM   #5
NickThissen
PowerPoster
 
Join Date: Apr 07
Location: The Netherlands
Posts: 4,220
NickThissen is a splendid one to behold (700+)NickThissen is a splendid one to behold (700+)NickThissen is a splendid one to behold (700+)NickThissen is a splendid one to behold (700+)NickThissen is a splendid one to behold (700+)NickThissen is a splendid one to behold (700+)NickThissen is a splendid one to behold (700+)
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, 03: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, 04:37 PM   #7
TheBigB
Frenzied Member
 
TheBigB's Avatar
 
Join Date: Mar 06
Location: Debug Window Status: Bored
Posts: 1,097
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, 04: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, 05:28 AM   #9
NickThissen
PowerPoster
 
Join Date: Apr 07
Location: The Netherlands
Posts: 4,220
NickThissen is a splendid one to behold (700+)NickThissen is a splendid one to behold (700+)NickThissen is a splendid one to behold (700+)NickThissen is a splendid one to behold (700+)NickThissen is a splendid one to behold (700+)NickThissen is a splendid one to behold (700+)NickThissen is a splendid one to behold (700+)
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, 04:48 PM   #10
koolsid
Comfortably Numb
 
koolsid's Avatar
 
Join Date: Feb 05
Location: Mumbai, India
Posts: 9,543
koolsid is a name known to all (1000+)koolsid is a name known to all (1000+)koolsid is a name known to all (1000+)koolsid is a name known to all (1000+)koolsid is a name known to all (1000+)koolsid is a name known to all (1000+)koolsid is a name known to all (1000+)koolsid is a name known to all (1000+)koolsid is a name known to all (1000+)koolsid is a name known to all (1000+)
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 by Clicking "Rate This Post" on the left hand side of the post!
VB 6.0 Code Generator for VB6, Working with Windows Registry, Creating Access Database via Code, Listview Sub Item Image, Common Dialog Control
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, MyFlickr

MyGear: Sony VGN-FZ27G with a triple boot between (XP + Office 2003 + VB6), (VISTA + Office 2007 + VS2008) and (Win7 + Office 2010 + VS2010)
koolsid is offline   Reply With Quote
Old Jan 6th, 2010, 10:36 AM   #11
BruceG
PowerPoster
 
BruceG's Avatar
 
Join Date: May 00
Location: New Jersey (USA)
Posts: 2,560
BruceG is a jewel in the rough (200+)BruceG is a jewel in the rough (200+)BruceG is a jewel in the rough (200+)
Modifications Required for VB6 Applications to Work on Vista

Hello all,

This is not a question, but an FYI.

This may be old news to some of you, but for those that are not aware, if you have Windows 7, MS provides a free "Virtual PC" that runs "XP Mode" that you can download from the following site:
http://www.microsoft.com/windows/vir.../download.aspx

Once you set it up, you can run XP in a separate window from your Win 7 desktop (from my perspective, it feels like you are running "gotomypc" or VNC or something similar). Anyway, all your Win 7 drives and folders are automatically shared on the virtual XP box. Anyway, this makes it easy to install VS/VB6 - there are none of the headaches that I have seen reported by folks trying to install VS/VB6 on Vista or Win 7. I was able to install VS6, then SP 5, then I registered some other AX controls I use(d), and loaded up an old VB6 app, and it worked without a hitch.

It is true I was a VB6 holdout for longer than most, but I did move over to the "dark side" of .NET over 2 1/2 years ago and have not done any new VB6 development since then; however I still do have a fair number of VB6 apps to maintain. This is my first development box that runs an OS higher than XP (although I have tested VB6 apps on Vista boxes).

So I just wanted to share this with you, and recommend this option for those of you who need to run VS/VB6 on a Win 7 box. Again to reiterate, AFAIK, the "Virtual XP box" option is only available on Win 7 (not Vista).
__________________
"It's cold gin time again ..."

Check out my website here.
BruceG 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
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 05:08 AM.





Acceptable Use Policy

Internet.com
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.