home *** CD-ROM | disk | FTP | other *** search
/ Master 95 #1 / MASTER95_1.iso / microsof / vbasic4 / vb4-6.cab / main.bas < prev    next >
Encoding:
BASIC Source File  |  1995-07-26  |  1.4 KB  |  27 lines

  1. Attribute VB_Name = "MainModule"
  2. #If Win16 Then
  3.     Declare Function WritePrivateProfileString Lib "KERNEL" (ByVal AppName$, ByVal KeyName$, ByVal keydefault$, ByVal FileName$) As Integer
  4.     Declare Function GetPrivateProfileString Lib "KERNEL" (ByVal AppName$, ByVal KeyName$, ByVal keydefault$, ByVal ReturnString$, ByVal NumBytes As Integer, ByVal FileName$) As Integer
  5. #Else
  6.     Declare Function WritePrivateProfileString Lib "Kernel32" Alias "WritePrivateProfileStringA" (ByVal AppName$, ByVal KeyName$, ByVal keydefault$, ByVal FileName$) As Long
  7.     Declare Function GetPrivateProfileString Lib "Kernel32" Alias "GetPrivateProfileStringA" (ByVal AppName$, ByVal KeyName$, ByVal keydefault$, ByVal ReturnString$, ByVal NumBytes As Long, ByVal FileName$) As Long
  8. #End If
  9.  
  10. Sub Main()
  11. Dim ReturnString As String
  12. '--- Check to see if we are in the VB.INI File.  If not, Add ourselves to the INI file
  13.     #If Win16 Then
  14.         Section$ = "Add-Ins16"
  15.     #Else
  16.         Section$ = "Add-Ins32"
  17.     #End If
  18.     
  19.     'Check to see if the Align.Connector entry is already in the VB.INI file.  Add if not.
  20.     ReturnString = String$(255, Chr$(0))
  21.     GetPrivateProfileString Section$, "Align.Connector", "NotFound", ReturnString, Len(ReturnString) + 1, "VB.INI"
  22.     If Left(ReturnString, InStr(ReturnString, Chr(0)) - 1) = "NotFound" Then
  23.         WritePrivateProfileString Section$, "Align.Connector", "0", "VB.INI"
  24.     End If
  25. End Sub
  26.  
  27.