School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 300,406 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,627 people online right now. Registration is fast and FREE... Join Now!




Vista Idiosyncrasies

 
Reply to this topicStart new topic

> Vista Idiosyncrasies, Getting programs to work in both XP & Vista

AdamSpeight2008
Group Icon



post 19 Nov, 2008 - 01:51 PM
Post #1


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.

CODE

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
CODE

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.
Go to the top of the page
+Quote Post


Register to Make This Ad Go Away!

jacobjordan
Group Icon



post 18 Jan, 2009 - 09:42 PM
Post #2
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.
Go to the top of the page
+Quote Post

Bort
Group Icon



post 26 Feb, 2009 - 07:30 AM
Post #3
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).
Go to the top of the page
+Quote Post


Fast ReplyReply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 


Lo-Fi Version Time is now: 11/7/09 10:48PM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month