How is it work?

G

Guest

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?
 
G

gene kelley

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
 
H

Herfried K. Wagner [MVP]

Siva said:
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>.
 
P

Pritcham

Hi

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

C-Services Holland b.v.

Siva said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top