Home All Groups Group Topic Archive Search About
Author
25 Jul 2006 11:15 PM
Siva
Hi,
I am working on VB project. I am new to VB. Could any one tells me what do
the following codes do?
Specially, what does GetPrivateProfileString do?

Private Declare Function GetPrivateProfileString _
   Lib "kernel32" Alias "GetPrivateProfileStringA" _
  (ByVal lpSectionName As String, _
   ByVal lpKeyName As Any, _
   ByVal lpDefault As String, _
   ByVal lpReturnedString As String, _
   ByVal nSize As Long, _
   ByVal lpFileName As String) As Long

Dim success As Long
   Dim nSize As Long
   Dim ret As String
   ret = Space$(2048)
   nSize = Len(ret)
   success = GetPrivateProfileString(lpSectionName, lpKeyName, _
                                     defaultValue, ret, nSize, inifile)

I have no idea what is going on here. What will be success value?

--
Thank you,

Siva

Author
26 Jul 2006 12:02 AM
gene kelley
On Tue, 25 Jul 2006 16:15:02 -0700, Siva <siva@newsgroups.nospam> wrote:

Show quoteHide quote
>Hi,
>I am working on VB project. I am new to VB. Could any one tells me what do
>the following codes do?
>Specially, what does GetPrivateProfileString do?
>
>Private Declare Function GetPrivateProfileString _
>   Lib "kernel32" Alias "GetPrivateProfileStringA" _
>  (ByVal lpSectionName As String, _
>   ByVal lpKeyName As Any, _
>   ByVal lpDefault As String, _
>   ByVal lpReturnedString As String, _
>   ByVal nSize As Long, _
>   ByVal lpFileName As String) As Long
>
>Dim success As Long
>   Dim nSize As Long
>   Dim ret As String
>   ret = Space$(2048)
>   nSize = Len(ret)
>   success = GetPrivateProfileString(lpSectionName, lpKeyName, _
>                                     defaultValue, ret, nSize, inifile)
>
>I have no idea what is going on here. What will be success value?

Looks to me that you are working in a VB6 project in which case you might want to ask in
a VB6 group:

microsoft.public.vb.general.discussion

Gene
Author
26 Jul 2006 10:56 AM
Herfried K. Wagner [MVP]
"Siva" <siva@newsgroups.nospam> schrieb:
> I am working on VB project. I am new to VB. Could any one tells me what do
> the following codes do?
> Specially, what does GetPrivateProfileString do?
>
> Private Declare Function GetPrivateProfileString _
>   Lib "kernel32" Alias "GetPrivateProfileStringA" _
>  (ByVal lpSectionName As String, _
>   ByVal lpKeyName As Any, _
>   ByVal lpDefault As String, _
>   ByVal lpReturnedString As String, _
>   ByVal nSize As Long, _
>   ByVal lpFileName As String) As Long

This is VB6 code.  You may want to check out the sample at
<URL:http://mentalis.org/soft/class.qpx?id=6>.

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>
Author
26 Jul 2006 12:15 PM
Pritcham
Hi

A Quick search in Google will tell you all you need to know about what
the function is for.

Martin
Herfried K. Wagner [MVP] wrote:
Show quoteHide quote
> "Siva" <siva@newsgroups.nospam> schrieb:
> > I am working on VB project. I am new to VB. Could any one tells me what do
> > the following codes do?
> > Specially, what does GetPrivateProfileString do?
> >
> > Private Declare Function GetPrivateProfileString _
> >   Lib "kernel32" Alias "GetPrivateProfileStringA" _
> >  (ByVal lpSectionName As String, _
> >   ByVal lpKeyName As Any, _
> >   ByVal lpDefault As String, _
> >   ByVal lpReturnedString As String, _
> >   ByVal nSize As Long, _
> >   ByVal lpFileName As String) As Long
>
> This is VB6 code.  You may want to check out the sample at
> <URL:http://mentalis.org/soft/class.qpx?id=6>.
>
> --
>  M S   Herfried K. Wagner
> M V P  <URL:http://dotnet.mvps.org/>
>  V B   <URL:http://classicvb.org/petition/>
Author
28 Jul 2006 11:42 AM
C-Services Holland b.v.
Siva wrote:
Show quoteHide quote
> Hi,
> I am working on VB project. I am new to VB. Could any one tells me what do
> the following codes do?
> Specially, what does GetPrivateProfileString do?
>
> Private Declare Function GetPrivateProfileString _
>    Lib "kernel32" Alias "GetPrivateProfileStringA" _
>   (ByVal lpSectionName As String, _
>    ByVal lpKeyName As Any, _
>    ByVal lpDefault As String, _
>    ByVal lpReturnedString As String, _
>    ByVal nSize As Long, _
>    ByVal lpFileName As String) As Long
>
> Dim success As Long
>    Dim nSize As Long
>    Dim ret As String
>    ret = Space$(2048)
>    nSize = Len(ret)
>    success = GetPrivateProfileString(lpSectionName, lpKeyName, _
>                                      defaultValue, ret, nSize, inifile)
>
> I have no idea what is going on here. What will be success value?
>

This will read a line from an .ini file.


--
Rinze van Huizen
C-Services Holland b.v