Results 1 to 5 of 5

Thread: ini trouble

  1. #1

    Thread Starter
    Addicted Member Jakys's Avatar
    Join Date
    Dec 1999
    Location
    Norway
    Posts
    180

    ini trouble

    i got an app getting program versions from an ini file... (its a setup app)

    i got this routine searching through the inifile for the version info, but i only get returned the first one...

    - In combo1, all the app names are loaded from the inifile (all the names between the "[" and "]")
    - AppNavn is a string containg the name of the app (which is the section of the inifile)
    - The programs you already got installed on your computer gets ": Update!" added, thats why i am removing it... (and it is correct, i have checked )
    - ReportText is only the variable which all the info should be stored....

    i think that was it... if something is unclear or you got any questions, just ask....


    VB Code:
    1. Do
    2.     AppNavn = frmMain.Combo1.Text
    3.     If Right(AppNavn, 7) = ":   Update!" Then AppNavn = Mid(AppNavn, 1, Len(AppNavn) - 11)
    4.     LocalVer = GetSetting(app.title & "\" & AppNavn, "Info", "Ver", "N/A")
    5.     Noko = GetPrivateProfileString(AppNavn, "version", "default", ReturnInfo, Len(ReturnInfo), App.Path & "\setup.xxx")
    6.     ReportText = ReportText & vbCrLf & AppNavn & "  -  Local version = " & LocalVer & ", Remote version = " & ReturnInfo
    7.     If frmMain.Combo1.ListIndex = frmMain.Combo1.ListCount - 1 Then Exit Do
    8.     frmMain.Combo1.ListIndex = frmMain.Combo1.ListIndex + 1
    9. Loop

    thanks in advance
    MSN: [email protected]

    "Enhetssirkelen løser alle problemer" - ÅJT

  2. #2

    Thread Starter
    Addicted Member Jakys's Avatar
    Join Date
    Dec 1999
    Location
    Norway
    Posts
    180
    please.....
    MSN: [email protected]

    "Enhetssirkelen løser alle problemer" - ÅJT

  3. #3
    Hyperactive Member rEaL iGoR's Avatar
    Join Date
    Apr 2001
    Location
    A secret!
    Posts
    417
    Sorry, can't help you out. Just thought I'd send this message back to the top, since I guess the topic is still valid
    VB, ADO, SQL, 3DSMAX, DHTML, VBscript, Javascript, CSS

    -Lars Espen Rosness

  4. #4

    Thread Starter
    Addicted Member Jakys's Avatar
    Join Date
    Dec 1999
    Location
    Norway
    Posts
    180
    i know it is something about the code where i get the version info returned, because if i set ReturnInfo to be "test", and i skip the
    VB Code:
    1. Noko = GetPrivateProfileString(AppNavn, "version", "N/A", ReturnInfo, Len(ReturnInfo), App.Path & "\setup.xxx")
    -line, then everything works the way it should, so i know the error is someplace here....

    here i decleare the functions:
    VB Code:
    1. Public Declare Function GetPrivateProfileInt Lib "kernel32" Alias "GetPriviteProfileIntA" (ByVal lpApplicationname As String, ByVal lpKeyName As String, ByVal nDefault As Long, ByVal lpFileName As String) As Long
    2. Public Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationname As String, ByVal lpKeyName As String, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long

    and this is the line i use to call them:
    VB Code:
    1. Noko = GetPrivateProfileString(AppNavn, "version", "default", ReturnInfo, Len(ReturnInfo), App.Path & "\setup.xxx")

    do anybody of you know why this doesn't work?
    MSN: [email protected]

    "Enhetssirkelen løser alle problemer" - ÅJT

  5. #5

    Thread Starter
    Addicted Member Jakys's Avatar
    Join Date
    Dec 1999
    Location
    Norway
    Posts
    180
    and what is GetPrivateProfileInt?
    MSN: [email protected]

    "Enhetssirkelen løser alle problemer" - ÅJT

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