|
-
Sep 18th, 2001, 06:23 PM
#1
Thread Starter
Junior Member
GetPrivateProfileString
When I try to read settings from an INI file using GetPrivateProfileString, my program crashes with this error message:

Code:
GetPrivateProfileString "default", "name", "(error)", s, 15, App.Path & "\sheepkill.ini"
What could be wrong?
-
Sep 18th, 2001, 07:29 PM
#2
Fanatic Member
Try this....I never use INI files.....all the samples I have use 255 for the length of the variable to hold the value.
VB Code:
s = String(255, 0)
x = GetPrivateProfileString("Default", "Name", "Default", s, 255, App.Path & "\sheepkill.ini" )
If x <> 0 Then
s = Left$(s, x)
End If
MsgBox s
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|