Real Geek Forums  

Go Back   Real Geek Forums > Archives > Operating Systems > Windows Vista > Windows Vista File Management

Notices

Reply

GetOpenFileName on Vista, won't recognise lpstrInitialDir

 

LinkBack Thread Tools Display Modes
Old 09-03-2007, 09:13 AM   #1 (permalink)
Default 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

JohnD
Guest
 
Posts: n/a
Reply With Quote  
Old 09-04-2007, 11:52 AM   #2 (permalink)
Default 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@dyalog.com> wrote in message
news:umMgLrg7HHA.4880@TK2MSFTNGP03.phx.gbl...
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
Marcin Domaslawski
Guest
 
Posts: n/a
Reply With Quote  
Old 03-27-2008, 01:13 AM   #3 (permalink)
Default 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
Zapf Bandit
Guest
 
Posts: n/a
Reply With Quote  
Reply

Tags
None

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads

Thread Thread Starter Forum Replies Last Post
Vista Cannot Recognise AVG Antivirus Software Guest Windows Vista 0 03-07-2008 07:05 PM
Vista does not recognise my monitor but XP does Spirefm Windows Vista Hardware & Devices 13 09-25-2006 03:58 AM
Vista won't recognise our lan when resuming from hibernate Ringbearer Windows Vista Networking & Sharing 0 06-30-2006 12:50 AM
PC won't recognise Camcorder Paul Windows XP Video 0 12-03-2003 03:25 PM


All times are GMT. The time now is 04:50 PM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright © 2005 - 2007 RealGeek.com. All rights reserved.

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 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90