Announcement

Collapse
No announcement yet.

Vista help

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Iain Johnstone
    replied
    Thank you all for your help - up and running fine now.
    MCM - my apologies for not acknowledging your contribution - very rude of me, but the topic had dropped off the bottom of my screen!

    Iain Johnstone

    Leave a comment:


  • Michael Mattias
    replied
    >I am awaiting a response from the customer for their machine.

    I hope you are not waiting for them to give you the correct name of some folder which exists on one of their systems, because that is just going to patch over the problem and it will break again in the future.

    Do your customer and yourself a favor and either...

    1. Use the SHGetSpecialFolderPath() function as shown in the link provided by Mr. Peel as the basis for whatever folder you want to use for storage/retrieval
    OR
    2. Put the name of the folder in a configuration file or in the registry as part of the "user options" setup for this application.

    Here's some slightly less cryptic code to locate data ..
    Move That INI File! and Get That Ini File Name!

    The functions in this post (several offerings from multiple contributors) can be adapted for many purposes.

    MCM

    Leave a comment:


  • Iain Johnstone
    replied
    Thank you Kev - this seems to have done the trick but I am awaiting a response from the customer for their machine. Obviously 'Zummerzet cyder' is good for the grey cells! I once had a holiday in St Louis and found out that Americans (generally) had no idea as to what cider is - obviously an exoprt potential there. I also visited an 'English Bar/Pub' in LA on a previous ocassion, and they also could not provide this nectar of the gods.

    Scott - I turned off UAC remotely (Teamviewer is a wonderful program) before getting stuck in sorting this out and it made no difference.

    Many thanks

    Iain Johnstone
    I.W. - U.K.

    Leave a comment:


  • Scott Slater
    replied
    It could also be a UAC issue if filepath is in a "protected" area under Vista.

    Leave a comment:


  • Iain Johnstone
    replied
    Thank you Kev - I shall give that a try tomorrow - looks like the problem.

    Edwin - you are quite correct - the freefile was a hangover that was not deleted - the #1 is the value that is used.

    Iain

    Leave a comment:


  • Edwin Knoppert
    replied
    I did not test but this looks like a flaw to me:

    filenumber=FREEFILE
    ATTRIB filepath,0
    OPEN filepath FOR OUTPUT AS #1

    Leave a comment:


  • Kev Peel
    replied
    You are hard coding a path that does not exist under Vista. Try using this code to find the correct path under all Windows versions:

    Multi-User Support in Your Applications

    Leave a comment:


  • Iain Johnstone
    started a topic Vista help

    Vista help

    I have a new customer running Vista Home on a Dell laptop. My program is refusing to run and fails at the same point. The relevant code snippet is below:-
    Code:
        GetUserName szStr, SIZEOF(szStr)
        temp=szstr
        ProfilePath="C:\Documents and Settings\"+temp+"\Application Data\Mstdrain\"
    
        IF DIR$ (ProfilePath)="" THEN   'new user
            DIALOG NEW gmain, "New user - setting up your copy.", 12, 115, 100, 0, TO hDlg2
            DIALOG SHOW MODELESS hDlg2
    
            MKDIR ProfilePath
    
            Filepath=ProfilePath+"MSTDRAIN.INI"
    
    ?"getting profile for "+filepath  'displays correct file path and name
    
    'OK to here
    '****************************************************
            OPEN filepath FOR BINARY AS #1
                 filesize=LOF(1)
            CLOSE #1
    'fails around here as msgboxes are never displayed
    'gets Vista failure notice instead
    '****************************************************
            IF filesize=0 THEN
             'create user ini
    ?"creating user ini"
                filenumber=FREEFILE
                ATTRIB filepath,0
                OPEN filepath FOR OUTPUT AS #1
                        WRITE #1,"~"
                        .................etc
                CLOSE #1
             ELSE
    ?"already exists
                        ................etc
            END IF
    This code runs perfectly well on XP machines and on my Vista laptop, and I cannot see what the problem is. Any ideas???

    Iain Johnstone
Working...
X