Article View: cn.bbs.comp.program
Article #1961Re: about use api in vb
From: ���
Date: Fri, 13 Mar 1998 00:00
Date: Fri, 13 Mar 1998 00:00
38 lines
1905 bytes
1905 bytes
> [1;36m==> Zm_Xu(���) ˵��: [37;40m[0m
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,mystr's value change to 2
Dim MYSTRING As String
lenmystriong = GetProfileString("intl", "iDigits", "400", TEXT1.Text, 20)
'this function return 0,so text1.text is "",can you tell me why? //thinkhard
LENMYSTRING = GetProfileString("windows", "device", "NOT", MYSTRING, 50)
'this functions return 0,and the value of MYSTRING IS "",why?
'in win.ini file ,the windows section has the follow line:
'device =HP DeskJet500 ........
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
at last i am sorry to say that i cannot answer your question about VBA,because
i just learn VB from this term,and know little about it.thank you for your help
ZZ
--
�� ��Դ: �й�ƴ�BBSվ [bbs.ustc.edu.cn]
Technical Details
Message-ID:
<980313.yDNBQ$PBBS@bbs.ustc.edu.cn>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: fc86e,770d63bcdd8715de X-Google-Attributes: gidfc86e,public From: Zm_Xu@bbs.ustc.edu.cn (���) Subject: Re: about use api in vb Date: 1998/03/13 Message-ID: <980313.yDNBQ$PBBS@bbs.ustc.edu.cn> X-Deja-AN: 333593732 Organization: �й�ƴ�BBSվ Newsgroups: cn.bbs.comp.program