Click here to Skip to main content
15,915,336 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: dot syntax and concatenated names Pin
FruitBatInShades9-Jan-03 10:24
FruitBatInShades9-Jan-03 10:24 
Generalbad dll calling convrention Pin
ns8-Jan-03 2:12
ns8-Jan-03 2:12 
GeneralRe: bad dll calling convrention Pin
geo_m9-Jan-03 8:59
geo_m9-Jan-03 8:59 
GeneralRe: bad dll calling convrention Pin
RichardGrimmer23-Jan-03 4:28
RichardGrimmer23-Jan-03 4:28 
Generalaccessing ini files Pin
r i s h a b h s7-Jan-03 18:28
r i s h a b h s7-Jan-03 18:28 
GeneralRe: accessing ini files Pin
Nick Seng7-Jan-03 20:07
Nick Seng7-Jan-03 20:07 
GeneralRe: accessing ini files Pin
r i s h a b h s7-Jan-03 23:23
r i s h a b h s7-Jan-03 23:23 
GeneralRe: accessing ini files Pin
Jerome Conus7-Jan-03 20:44
Jerome Conus7-Jan-03 20:44 
I personnally use the windows API. I declare this :

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


Public Declare Function WritePrivateProfileString Lib "kernel32" _
                        Alias "WritePrivateProfileStringA" _
                        (ByVal lpApplicationName As String, _
                        ByVal lpKeyName As Any, _ 
                        ByVal lpString As Any, _ 
                        ByVal lpFileName As String) As Long


to ba able to use the API function, then, in my code, when I want to read a parameter in the .INI file, I do this :

Dim l_sStringRead as String
Dim l_lRet as Long

l_sStringRead= "                                                                 "
               ' I do this to allow some memory for the string which will be passed
               ' as a parameter

l_lRet = GetPrivateProfileString("Section", "Parameter", "DefaultResult",_
                                 l_sStringRead , Len(l_sStringRead ), "MyINIfile.INI")
l_sStringRead = Left(l_sStringRead , l_lRet) ' l_lRet = length of string returned


If you want to write into the INI file, use this :

Dim l_lRet as Long
l_lRet = WritePrivateProfileString("Section", "Parameter", _
                                   "ValueToStore", "MyINIfile.INI")


Hope this helps !
Jerome
Generalpadding a string Pin
ns7-Jan-03 8:48
ns7-Jan-03 8:48 
GeneralRe: padding a string Pin
Hesham Amin8-Jan-03 11:28
Hesham Amin8-Jan-03 11:28 
GeneralRe: padding a string Pin
ns9-Jan-03 4:58
ns9-Jan-03 4:58 
Generalpassing a string array to a C dll Pin
ns7-Jan-03 4:21
ns7-Jan-03 4:21 
GeneralRe: passing a string array to a C dll Pin
Nick Parker7-Jan-03 4:58
protectorNick Parker7-Jan-03 4:58 
Questionhow to assign variable Pin
Nashes6-Jan-03 18:46
Nashes6-Jan-03 18:46 
AnswerRe: how to assign variable Pin
Nick Seng7-Jan-03 14:33
Nick Seng7-Jan-03 14:33 
GeneralAlternative to Timer object Pin
Ruca6-Jan-03 5:53
Ruca6-Jan-03 5:53 
GeneralRe: Alternative to Timer object Pin
Richard Deeming6-Jan-03 6:20
mveRichard Deeming6-Jan-03 6:20 
GeneralRe: Alternative to Timer object Pin
Ruca6-Jan-03 6:31
Ruca6-Jan-03 6:31 
GeneralUsing Web Services and XML Pin
Matt Philmon6-Jan-03 5:43
Matt Philmon6-Jan-03 5:43 
Generalextracting new autonumber from database Pin
mcm6-Jan-03 4:47
mcm6-Jan-03 4:47 
GeneralRe: extracting new autonumber from database Pin
Nick Seng6-Jan-03 14:17
Nick Seng6-Jan-03 14:17 
GeneralNeed help updating vb script Pin
NeedingHelp6-Jan-03 4:25
NeedingHelp6-Jan-03 4:25 
GeneralRe: Need help updating vb script Pin
Ray Cassick6-Jan-03 5:02
Ray Cassick6-Jan-03 5:02 
GeneralRe: Need help updating vb script Pin
NeedingHelp6-Jan-03 5:28
NeedingHelp6-Jan-03 5:28 
GeneralRe: Need help updating vb script Pin
Ray Cassick6-Jan-03 6:24
Ray Cassick6-Jan-03 6:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.