Sorry ... I meant to include links to net groups where you might find a
comp***ionate ear ..
news://msnews.microsoft.com/microsof...dotnet.general news://msnews.microsoft.com/microsof...t.languages.vb news://msnews.microsoft.com/microsof....vsnet.general
--
Randy Birch
MVP Visual Basic
http://vbnet.mvps.org/
Please respond only to the newsgroups so all can benefit.
"Randy Birch" <EMAIL REMOVED> wrote in message
news:Sn2Yc.77848$EMAIL REMOVED. cable.rogers.com...
: Nope ... my .net disks are used as coasters, so I can feel there is at
least
: some redeeming value to the product.
:
:: Date: 2003-02-03 19:24:40 PST
:
: golly ... that's why I hate google! <g>
:
: --
:
: Randy Birch
: MVP Visual Basic
:
http://vbnet.mvps.org/
: Please respond only to the newsgroups so all can benefit.
:
:
: "Mark Hayworth" <EMAIL REMOVED> wrote in message
: news:EMAIL REMOVED m...
:: Randy:
:: I too am having the problem that this other guy/girl had. I put in
:: the proper API declarations and arguments for GetPrivateProfileString
:: yet it doesn't return the correct stuff. It always returns the
:: default value (padded with huge amount of spaces on the right) and the
:: return value (number of characters read) is some crazy huge number
:: like 51298398749084
:: Your demo doesn't work in .Net - it's for prior versions of VB, and so
:: the problem still remains. Have you had any luck with
:: GetPrivateProfileString in VB.Net?
:: Mark Hayworth
::
::
::
::
:: From: Randy Birch (EMAIL REMOVED)
:: Subject: Re: Why won't GetPrivateProfileString work?
::
::
:: View this article only
:: Newsgroups: comp.lang.visual.basic
:: Date: 2003-02-03 19:24:40 PST
::
::
:: Examine the basic private profile demo at
::
http://www.mvps.org/vbnet/code/file/pprofilebasic.htm
::
:: --
::
:: Randy Birch
:: MVP Visual Basic
::
http://www.mvps.org/vbnet/
:: Please respond only to the newsgroups so all can benefit.
::
::
:: "nospam" <EMAIL REMOVED> wrote in message
:: news

EMAIL REMOVED...
:: # I can't for the life of me to get the GetPrivateProfileString API
:: function
:: # to work correctly in VB.NET, although I've gotten
:: # WritePrivateProfileString to work. Listed below after this message
:: # are the function declarations I'm using.
:: #
:: # These two functions write to the test.ini as they should:
:: # WritePrivateProfileString("Section1", "FirstKey", "First Value",
:: "test.ini")
:: # WritePrivateProfileString("Section2", "SecondKey", "Second Value",
:: "test.ini")
:: #
:: #
:: # But when I try and read the values back, all that is copied to the
:: buffer
:: # is the "Default" value:
:: #
:: # GetPrivateProfileString("Section1", "FirstKey", "Default", Buffer,
:: 255,
:: # "test.ini")
:: #
:: # MsgBox(Buffer, MsgBoxStyle.OKOnly, "Ini Test")
:: #
:: #
:: # I also tried hard coding the path to the test.ini file, but that
:: didn't
:: # work either. Any ideas why GetPrivateProfileString isn't working?
:: #
:: # -Thanks
:: #
:: #
:: # Function Declarations:
:: #
:: # Private 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
:: #
:: #
:: # Private Declare Function WritePrivateProfileString Lib "kernel32"
:: Alias _
:: # "WritePrivateProfileStringA" (ByVal lpSectionName As String, ByVal
:: _
:: # lpKeyName As String, ByVal lpString As String, ByVal lpFileName As
:: String) As Long
:: #
: