Visual Studio 6.0; VB6 GetAllSettings function does not seem to work in Vista RC-1

Visual Studio 6 seems to come up correctly however when testing stable VB6 application the following line:

varFiles = GetAllSettings(ThisApp, FileKey)

produces "Run-time error '5'; Invalid procedure call or argument. Both procedure call and arguments from this working program are valid.

This project is completely stable on WinXP machines and below. I have not seen this error until upgrading to Vista. All other VB6 code seems to work correctly on Vista. Other registry access commands appear to work correctly. However, GetAllSettings seems to produce an invalid procedure call wherever it occurs.

For some reason the service pack number does not seem to be coming up on the Visual Studio logo screen so I attempted to install (or reinstall) SP6. It would not install on Vista only indicating that the load was unsuccessful.

Also interesting, this code does work correctly when compiled on Vista/VS6. Just won't run from the IDE.

I have not been able to find other reports of this anomaly on the internet or MS-Knowedgebase. Does anyone know of a fix or workaround?

[1132 byte] By [hjachter] at [2007-12-28]
# 1

I am having the same problem...did you find out anything more.

I am actually using Vista Enterprise.

Brady11 at 2007-9-4 > top of Msdn Tech,Software Development for Windows Vista,General Windows Vista Development Issues...
# 2
The problem disappeared when I upgraded to Vista RC-2.
hjachter at 2007-9-4 > top of Msdn Tech,Software Development for Windows Vista,General Windows Vista Development Issues...
# 3
I am using Vista Enterprise...not an RC, so watch your app in the future.
Brady11 at 2007-9-4 > top of Msdn Tech,Software Development for Windows Vista,General Windows Vista Development Issues...
# 4

Just to make it short and sweet.

Get rid of VS 6.0. It's ancient!! It was released in 1997

TDSdev at 2007-9-4 > top of Msdn Tech,Software Development for Windows Vista,General Windows Vista Development Issues...
# 5

I develop in VB2005 but since I was around in 1997-2000 I made the mistake of developing significant code during that time which still has considerable functional value. Actually, I am rewriteing some of this in the latest version of .NET, but in the meantime I need to maintain legacy.

After a few years you'll discover that this is the reality of the sw developer.

Best,

Howard

hjachter at 2007-9-4 > top of Msdn Tech,Software Development for Windows Vista,General Windows Vista Development Issues...
# 6

Actually it came out October 1998 from what I can see.

In any case, if your program actually updates these Registry settings after the installer runs (and if it's like most old VB programs it does) you might want to consider what Registry Virtualization is doing to you.

As I understand it when a program tries to write to these keys in HKLM they'll be redirected to a per-user part of the Registry instead. This means when another user runs your program it won't find any settings on first run, and if it writes anything back it'll end up storing yet-another per-user set of settings.

The Vista message seems to go something like "you can persist initial settings into HKLM during setup/install, but after that you should store any per-computer data or settings needing updates in a file within the CommonAppData path."

For a VB6 program the easiest way to locate this path reliably is probably through the Microsoft Shell Controls and Automation library (Shell32.dll, progID "Shell.Application") or directly through Shell API calls. You use the ShellSpecialFolderConstants value ssfCOMMONAPPDATA or the API #define CSIDL_COMMON_APPDATA.

But if I'm wrong somebody please correct me.

BobRiemersma at 2007-9-4 > top of Msdn Tech,Software Development for Windows Vista,General Windows Vista Development Issues...
# 7
I have exactly the same problem with getAllSettings and with DeleteSetting.
DeleteSetting only works if you specify a Key in DeleteSetting(Appname,Section,[Key}). so I need to find all the Keys to remove all Settings under a particular Section.
hjachter, have you solved this yet - short of the smartarse suggestions of "change to .net.? email me if you have an answer at
roy at low dot net dot au
roylow at 2007-9-4 > top of Msdn Tech,Software Development for Windows Vista,General Windows Vista Development Issues...

Software Development for Windows Vista

Site Classified