Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Vista Newsgroups > Vista file management

GetOpenFileName on Vista, won't recognise lpstrInitialDir

Closed Thread
 
Thread Tools Display Modes
Old 09-03-2007   #1 (permalink)
JohnD
Guest
 
Posts: n/a

GetOpenFileName on Vista, won't recognise lpstrInitialDir

Hello All,

I posted this on the programmer.ui group and got no help, so I'm
cross-posting here. Hope that's OK.

I've got a problem with GetOpenFileName on Vista.

It never recognises the lpstrInitialDir field of the OPENFILE structure and
always starts off in the current working directory.

The code works fine on XP and the other systems.

Anyone seen this and worked around it?

/john

 
Old 09-04-2007   #2 (permalink)
Marcin Domaslawski
Guest
 
Posts: n/a

Re: GetOpenFileName on Vista, won't recognise lpstrInitialDir

Hi,

For me code:
http://msdn2.microsoft.com/en-us/library/ms646829.aspx
works fine also for Vista.

Checked on VS2005 with SDK for Vista

Marcin Domaslawski



"JohnD" <johnd@xxxxxx> wrote in message
news:umMgLrg7HHA.4880@xxxxxx
Quote:

> Hello All,
>
> I posted this on the programmer.ui group and got no help, so I'm
> cross-posting here. Hope that's OK.
>
> I've got a problem with GetOpenFileName on Vista.
>
> It never recognises the lpstrInitialDir field of the OPENFILE structure
> and
> always starts off in the current working directory.
>
> The code works fine on XP and the other systems.
>
> Anyone seen this and worked around it?
>
> /john
 
Old 03-26-2008   #3 (permalink)
Newbie
Zapf Bandit is on a distinguished road
 
Join Date: Mar 2008
xp 32bit
Posts: 1

Re: GetOpenFileName on Vista, won't recognise lpstrInitialDir

The problem is that in XP the "lpstrInitialDir" can take a file path and it is smart enough to realise that you are refering to the directory that contains this file. With Vista it ONLY accepts a directory path. Some simple string manipulation should be able to fix this fairly easily.
Zapf Bandit is offline  
 
Closed Thread

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
vista doesn't recognise device T5 Vista security 1 01-09-2008 02:19 PM
Vista does not recognise USB mouse Aaron B Vista General 17 12-05-2007 05:50 AM
vista doesn't recognise device T5 Vista General 6 08-24-2007 06:40 PM
Vista does not recognise DVD Maggie Vista music pictures video 1 03-22-2007 02:47 AM
Vista does not recognise my monitor but XP does =?Utf-8?B?U3BpcmVmbQ==?= Vista hardware & devices 13 09-24-2006 10:58 PM








Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49