Windows Vista Forums

GetOpenFileName on Vista, won't recognise lpstrInitialDir
  1. #1


    JohnD Guest

    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


      My System SpecsSystem Spec

  2. #2


    Marcin Domaslawski Guest

    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

    > 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

      My System SpecsSystem Spec

  3. #3



    Newbie
    Join Date : Mar 2008
    Posts : 1
    xp 32bit
    Local Time: 01:48 AM


     

    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.

      My System SpecsSystem Spec

GetOpenFileName on Vista, won't recognise lpstrInitialDir problems?

Similar Threads
Thread Thread Starter Forum Replies Last Post
Vista won't recognise DVD's ensignabbi Vista General 2 10 Nov 2008
Vista won't recognise external HDD sometimes Charles Vista General 2 06 Nov 2008
Vista does not recognise USB mouse Aaron B Vista General 17 05 Dec 2007
Vista does not recognise DVD Maggie Vista music pictures video 1 22 Mar 2007
Vista does not recognise my monitor but XP does =?Utf-8?B?U3BpcmVmbQ==?= Vista hardware & devices 13 24 Sep 2006