🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: cn.bbs.comp.program
Article #1960

Re: about use api in vb

#1960
From: Henry Jia
Date: Fri, 13 Mar 1998 00:00
50 lines
2149 bytes
The string need init, it should be something like this:

    dim nLen as integer
    dim sRead as string

    sRead=string(255,0)
    nLen = GetProfileString("windows", "device", "NOT", sRead, 255)
    sRead=left$(sRead,nLen)

    Hope this help and good luck!

Jia H
Xi'an Orient
ShaanXi    China

��� wrote in message <980312.yD0sP$PBBS@bbs.ustc.edu.cn>...
>> ==> Walker_W(�ú�)                           ˵��: 
>>
>> If you use  vb for win31, you can use getprofilestring easily.
>> and if you use vb for win95, getprofilestring is ok.
>> but you can do sme actions to registry table.
>> btw, getprofilestring is easy to use. would youi please
>> paste your program ?
> one of the sub i use this api function as follow:
>Private Sub Form_Load()
>    mystr = GetProfileInt("intl", "iDigits", 400)  'this function can
ruturn correctly
>    Dim MYSTRING As String
>    'lenmystriong = GetProfileString("intl", "iDigits", "400", TEXT1.Text,
20)
>    LENMYSTRING = GetProfileString("windows", "device", "NOT", MYSTRING,
50)
>'this functions return 0,and the value of MYSTRING IS ""
>    TEXT1.Text = MYSTRING
>
>End Sub
>'the follow is code in general model
>Option explicit
>Declare Function GetProfileInt Lib "kernel32" Alias "GetProfileIntA" (ByVal
lpAppName As String, ByVal lpKeyName As String, ByVal nDefault As Long) As
Long
>Declare Function GetProfileString Lib "kernel32" Alias "GetProfileStringA"
(ByVal lpAppName As String, ByVal lpKeyName As String, ByVal lpDefault As
String, ByVal lpReturnedString As String, ByVal nSize As Long) As Long
>
>BTW:i use vb in win95
>
>--
>�� ��Դ: �й�ƴ�BBSվ [bbs.ustc.edu.cn]
Technical Details
Message-ID: <6e9tde$6o5@news.zhanjiang.gd.cn>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <980312.yD0sP$PBBS@bbs.ustc.edu.cn>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: fc86e,770d63bcdd8715de
X-Google-Attributes: gidfc86e,public
From: "Henry Jia" <jiah@usa.net>
Subject: Re: about use api in vb
Date: 1998/03/13
Message-ID: <6e9tde$6o5@news.zhanjiang.gd.cn>
X-Deja-AN: 333506909
References: <980312.yD0sP$PBBS@bbs.ustc.edu.cn>
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4
Organization: ZJDCB
Newsgroups: cn.bbs.comp.program