Modifications Required for VB6 Applications to Work on Vista/7-VBForums
Results 1 to 13 of 13

Thread: Modifications Required for VB6 Applications to Work on Vista/7

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member Hassan Basri's Avatar
    Join Date
    Sep 2006

    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


    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts


Click Here to Expand Forum to Full Width