No announcement yet.

VB6 GetTempPath API call in WinXP

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

  • VB6 GetTempPath API call in WinXP

    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
    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.

    Comment


    • #3
      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.

      Comment


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

        Comment


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

          Comment


          • #6
            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.

            Comment

            Working...
            X