Page 1 of 1

Vista Idiosyncrasies Getting programs to work in both XP & Vista Rate Topic: -----

#1 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 2241
  • View blog
  • Posts: 9,416
  • Joined: 29-May 08

Post icon  Posted 19 November 2008 - 02:51 PM

I know a lot people are confused to why their application works on XP but not Vista. The basis of this tutorial is examine, explain and offer solutions.

Let's take this simple console application.

Module Module1
	Sub Main()
		Console.WriteLine(My.Computer.FileSystem.SpecialDirectories.AllUsersApplicationData)
		Console.ReadLine()
	End Sub
End Module



When run on;-
Vista
C:\ProgramData\ConsoleApplication1\ConsoleApplication1\1.0.0.0

XP
C:\Documents and Setting\All Users\Application Data\ConsoleApplication1\ConsoleAppliction1\1.0.0.0

Two totally different locations.
TIP 1 Don't hard code any file locations.


Example 2: The location of the .EXE
Module Module1

	Sub Main()
		Console.WriteLine(System.Windows.Forms.Application.ExecutablePath)
		Console.ReadLine()

	End Sub

End Module

Add a reference to the System.Windows.Forms namespace

Vista
C:\Users\Adam Speight\AppData\Local\Temporary Projects\ConsoleApplication1\bin\Debug\ConsoleApplication1.EXE
XP
c:\Documents and Settings\Adam Speight\Local Setting\Application Data\Temporary Project\ConsoleApplication1\ConsoleApplication1.EXE
TIP 2 Don't hard code any file locations.

More examples to follow.

Is This A Good Question/Topic? 1
  • +

Replies To: Vista Idiosyncrasies

#2 jacobjordan  Icon User is offline

  • class Me : Perfection
  • member icon

Reputation: 113
  • View blog
  • Posts: 1,499
  • Joined: 11-June 08

Posted 18 January 2009 - 10:42 PM

And one of the reasons a lot of applications will run on Vista and not XP is because they reference the dwmapi.dll to draw Aero glass inside the client area of their form so the UI will better integrate with Vista Aero style. That will make the application non-runnable in XP in most cases. Another main reason some application run only in Vista is because M$ purposely made it that way to force users to upgrade.
Was This Post Helpful? 0
  • +
  • -

#3 Bort  Icon User is offline

  • Ill-informed Mongoloid
  • member icon

Reputation: 396
  • Posts: 2,923
  • Joined: 18-September 06

Posted 26 February 2009 - 08:30 AM

Also, Vista's Data Execution Prevention (DEP) is not compatible with ActiveX controls made using the Active Template Library 7.1 or earlier. If you are using such a control, either refer to the manufacturer for a new version, or find a way around DEP (not really recommended as this is bypassing your computer security).
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1