Results 1 to 2 of 2

Thread: Windows Temp Directory

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    22

    Post

    Hi, I am trying to find out the windows tempoary directory by using the API function GetTempPath, but all I am getting are a bunch of strenge number and an empty string. Does anyone know how to use that function and if not, is there any other way to solve my problem?

  2. #2
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744

    Post

    Sure.

    Code:
    Private Declare Function GetTempPath Lib "kernel32" Alias "GetTempPathA" (ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long
    
    Private Sub Form_Load()
        Dim lRet As Long
        Dim strBuffer As String
        
        strBuffer = Space(125)
        lRet = GetTempPath(Len(strBuffer), strBuffer)
        If lRet Then MsgBox "Temp Directory: " & Left(strBuffer, lRet)
    End Sub
    ------------------

    Serge

    Senior Programmer Analyst
    sdymkov@microage.com
    Access8484@aol.com
    ICQ#: 51055819

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width