Please report all spam threads and posts, and suspicious members. We receive the spam notifications by email and will take immediate action!
Results 1 to 6 of 6

Thread: VB6 GetTempPath API call in WinXP

  1. #1
    Birdkiller is offline Senior Member
    Join Date
    Feb 2002
    Posts
    757

    Default

    ok i've been trying to get the GetTempPath API to work in Visual Basic in winxp with no luck, VB just hangs for a few seconds then crashes.

    hopefully someone can help, heres the code i got:

    Module decleration as per API viewer:

    Public Declare Function GetTempPath Lib "kernel32" Alias "GetTempPathA" (ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long

    main code:

    Dim retval As Long
    Dim pathbuffer As String * 512

    retval = GetTempPath(512, pathbuffer)

  2. #2
    Osiris is offline Banned
    Join Date
    Nov 2001
    Posts
    674

    Default

    Working fine for me, Birdy :(.

    Maybe put the API declaration in the General section of the form's code, and make sure it's declaring the API function as Private.

  3. #3
    Birdkiller is offline Senior Member
    Join Date
    Feb 2002
    Posts
    757

    Default

    nope declared as private in the forms general declerations still makes it crash. :cry:

    i'll try it on another computer soon, might just be my installation is screwy. its silly though cause other APIs work fine.

  4. #4
    Osiris is offline Banned
    Join Date
    Nov 2001
    Posts
    674

    Default

    Odd, if all the other APIs work... ah well, give it a crack on another machine / reinstall, see what happens then :).

  5. #5
    Birdkiller is offline Senior Member
    Join Date
    Feb 2002
    Posts
    757

    Default

    hhmmm it works now. i've changed nothing but today it decided to start working, hope it stays working :no:

  6. #6
    Osiris is offline Banned
    Join Date
    Nov 2001
    Posts
    674

    Default

    Quote Originally Posted by Birdkiller
    hhmmm it works now. i've changed nothing but today it decided to start working, hope it stays working :no:
    *Fingers crossed* :D.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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