GetPrivateProfileString problem!

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Domac

    #1

    GetPrivateProfileString problem!

    I need to read some configuration data from .ini file located at
    Application.Sta rtupPath location .


    Here is code snippet :

    Public Declare Unicode Function GetPrivateProfi leString Lib "kernel32" Alias
    "GetPrivateProf ileStringW" (ByVal lpApplicationNa me As String, ByVal
    lpKeyName As String, ByVal lpDefault As String, ByVal lpReturnedStrin g As
    String, ByVal nSize As Int32, ByVal lpFileName As String) As Int32


    Dim File As String = Application.Sta rtupPath & "\" & filename


    x = GetPrivateProfi leString("Confi guration", "DestDbPath ", "Error",
    tmpString, Len(tmpString), filename)

    What is the problem; Everything works fine on XP platform but when I deploy
    application on Win98 platform i have problem.



    File path is correct, file is correctly formated :

    [Configuration]
    DestDbPath = \\tlos-server\podaci\n ucleus2002\Baza-proizvodnja.mdb
    SourceXMLPath = c:\tlos\izdatni ce
    SkladIDs = 655
    OJ = 11
    User = Domagoj Kovaèeviæ


    GetPrivateProfi leString function doesn't retreive data for requested
    parameter but fills string buffer passed as reference with "Error"
    What to do??????


    Is my API declaration correct , I have "googled" and realized that there is
    problem with GetPrivateProfi leString function , what is solution????
    Win98 platform is mandatory!
    I got about 25 stations with Windows 98!


    Thanks a lot!






  • GhostInAK

    #2
    Re: GetPrivateProfi leString problem!

    Hello Domac,

    http://msdn.microsoft.com/library/de...filestring.asp
    Do your stations have the Microsoft Layer for Unicode installed?

    -Boo
    [color=blue]
    > I need to read some configuration data from .ini file located at
    > Application.Sta rtupPath location .
    >
    > Here is code snippet :
    >
    > Public Declare Unicode Function GetPrivateProfi leString Lib "kernel32"
    > Alias "GetPrivateProf ileStringW" (ByVal lpApplicationNa me As String,
    > ByVal lpKeyName As String, ByVal lpDefault As String, ByVal
    > lpReturnedStrin g As String, ByVal nSize As Int32, ByVal lpFileName As
    > String) As Int32
    >
    > Dim File As String = Application.Sta rtupPath & "\" & filename
    >
    > x = GetPrivateProfi leString("Confi guration", "DestDbPath ", "Error",
    > tmpString, Len(tmpString), filename)
    >
    > What is the problem; Everything works fine on XP platform but when I
    > deploy application on Win98 platform i have problem.
    >
    > File path is correct, file is correctly formated :
    >
    > [Configuration]
    > DestDbPath = \\tlos-server\podaci\n ucleus2002\Baza-proizvodnja.mdb
    > SourceXMLPath = c:\tlos\izdatni ce
    > SkladIDs = 655
    > OJ = 11
    > User = Domagoj Kovaèeviæ
    > GetPrivateProfi leString function doesn't retreive data for requested
    > parameter but fills string buffer passed as reference with "Error"
    > What to do??????
    >
    > Is my API declaration correct , I have "googled" and realized that
    > there is
    > problem with GetPrivateProfi leString function , what is solution????
    > Win98 platform is mandatory!
    > I got about 25 stations with Windows 98!
    > Thanks a lot!
    >[/color]


    Comment

    Working...