home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / firsto1r / frmmain.frm (.txt) next >
Encoding:
Visual Basic Form  |  1999-08-02  |  3.6 KB  |  110 lines

  1. VERSION 5.00
  2. Begin VB.Form Form1 
  3.    AutoRedraw      =   -1  'True
  4.    BorderStyle     =   4  'Fixed ToolWindow
  5.    Caption         =   "Load information from a Dll"
  6.    ClientHeight    =   3300
  7.    ClientLeft      =   45
  8.    ClientTop       =   285
  9.    ClientWidth     =   5745
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    ScaleHeight     =   3300
  14.    ScaleWidth      =   5745
  15.    ShowInTaskbar   =   0   'False
  16.    StartUpPosition =   2  'CenterScreen
  17.    Begin VB.Line Line3 
  18.       X1              =   5760
  19.       X2              =   0
  20.       Y1              =   3240
  21.       Y2              =   3240
  22.    End
  23.    Begin VB.Line Line2 
  24.       X1              =   3240
  25.       X2              =   3240
  26.       Y1              =   2400
  27.       Y2              =   3240
  28.    End
  29.    Begin VB.Label Label3 
  30.       BackStyle       =   0  'Transparent
  31.       Caption         =   "<--click the link to visit mostafa page for more samples or to send your comments"
  32.       Height          =   615
  33.       Left            =   3480
  34.       TabIndex        =   2
  35.       Top             =   2520
  36.       Width           =   2175
  37.    End
  38.    Begin VB.Line Line1 
  39.       X1              =   0
  40.       X2              =   6120
  41.       Y1              =   2400
  42.       Y2              =   2400
  43.    End
  44.    Begin VB.Label Label2 
  45.       BackStyle       =   0  'Transparent
  46.       Caption         =   "Mostafa Mohamed"
  47.       BeginProperty Font 
  48.          Name            =   "MS Sans Serif"
  49.          Size            =   8.25
  50.          Charset         =   0
  51.          Weight          =   400
  52.          Underline       =   -1  'True
  53.          Italic          =   0   'False
  54.          Strikethrough   =   0   'False
  55.       EndProperty
  56.       ForeColor       =   &H00FF0000&
  57.       Height          =   255
  58.       Left            =   1800
  59.       MouseIcon       =   "frmmain.frx":0000
  60.       MousePointer    =   99  'Custom
  61.       TabIndex        =   1
  62.       ToolTipText     =   "Mostafa web page"
  63.       Top             =   2520
  64.       Width           =   1335
  65.    End
  66.    Begin VB.Label Label1 
  67.       BackStyle       =   0  'Transparent
  68.       Caption         =   "Sample created by:-"
  69.       Height          =   255
  70.       Left            =   120
  71.       TabIndex        =   0
  72.       Top             =   2520
  73.       Width           =   1695
  74.    End
  75. Attribute VB_Name = "Form1"
  76. Attribute VB_GlobalNameSpace = False
  77. Attribute VB_Creatable = False
  78. Attribute VB_PredeclaredId = True
  79. Attribute VB_Exposed = False
  80. 'This sample created by Mostafa Mohamed,any comments please
  81. 'send me an email from my page at
  82. '"Explorer http://www.geocities.com/ResearchTriangle/Campus/4598/Vb1.HTML"
  83. Dim dll As Long
  84. Public Function stringfromdll(id As Long, dll As Long) As String
  85. Dim rtrn As Long
  86. Dim bstr As String * 255
  87. 'this function will load the string from the dll by the id and will put it on bstr
  88. rtrn = LoadString(dll, id, bstr, 255)
  89. 'format the string
  90. stringfromdll = Mid(bstr, 1, InStr(1, bstr, Chr(0)) - 1)
  91. End Function
  92. Private Sub Form_Load()
  93. 'load the dll using windows api function "LoadLibrary"
  94. dll = LoadLibrary(App.Path & "\myres.dll")
  95. 'print first string
  96. Print stringfromdll(101, dll)
  97. Print stringfromdll(102, dll)
  98. Print stringfromdll(103, dll)
  99. Print stringfromdll(104, dll)
  100. Print stringfromdll(105, dll)
  101. Print stringfromdll(107, dll)
  102. Print stringfromdll(108, dll)
  103. 'close the library
  104. FreeLibrary dll
  105. End Sub
  106. Private Sub Label2_Click()
  107. On Error Resume Next
  108. Shell ("Explorer http://www.geocities.com/ResearchTriangle/Campus/4598/Vb1.HTML"), vbNormalNoFocus
  109. End Sub
  110.