🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: cn.bbs.comp.program
1 messages
1 total messages Started by ��� Fri, 13 Mar 1998 00:00
Re: about use api in vb
#1961
Author: ���
Date: Fri, 13 Mar 1998 00:00
38 lines
1905 bytes
> ==> Zm_Xu(���)                              ˵��: 
  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]
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads