G
Guest
Has any got GetPrivateProfileString to work in vb.net? I am upgrading from VB6.
Code snippet:
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
Dim sBuf As String, lreturn As Long
Dim strTemp As String
Dim strTemp2 As String
Dim lSize As Long
strTemp = New String(CChar(" "), BufferLen)
lSize = Len(strTemp)
Try
lreturn = GetPrivateProfileString(SectionName, KeyName, strDef, strTemp, lSize, IniFile)
Code snippet:
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
Dim sBuf As String, lreturn As Long
Dim strTemp As String
Dim strTemp2 As String
Dim lSize As Long
strTemp = New String(CChar(" "), BufferLen)
lSize = Len(strTemp)
Try
lreturn = GetPrivateProfileString(SectionName, KeyName, strDef, strTemp, lSize, IniFile)