by Prabir Kumar Das (7 Submissions)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Mon 17th April 2006
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Use of DLL Component. The code helps to use of DLL files and how to work with it. (From:Prabir Kumar Das Konnagar,West Bengal) Contact me
API Declarations
'to work in a Standard EXE form by adding the reference of the DLL file from
'project/Reference. "THIS CODE IS USED TO CALCULATE THE TICKECT FARE OF TRAIN."
Const r_charge_1A = 35
Const r_charge_2A = 25
Const r_charge_3A = 25
Const r_charge_FC = 25
Const r_charge_CC = 25
Const r_charge_SL = 20
Const sf_charge = 20
Dim res_charge As Currency
Dim sfast_charge As Currency
Dim total_fare As Currency
Dim in_fare As Currency
If Class = "1A" And TYP = "EXP" Then
in_fare = fare * pass
res_charge = pass * r_charge_1A
total_fare = in_fare + res_charge
ElseIf Class = "SL" And TYP = "SUPERFAST" Then
in_fare = fare * pass
res_charge = pass * r_charge_SL
sfast_charge = pass * sf_charge
total_fare = in_fare + res_charge + sfast_charge
ElseIf Class = "2A" And TYP = "EXP" Then
in_fare = fare * pass
res_charge = pass * r_charge_2A
total_fare = in_fare + res_charge
Else
MsgBox "No such option", vbExclamation
End If
End Sub
Public Property Get fare() As Currency
fare = total_fare
End Property
Public Property Get reserve() As Currency
reserve = res_charge
End Property
Public Property Get super_fast() As Currency
super_fast = sfast_charge
End Property
Public Sub RESET()
res_charge = 0
sfast_charge = 0
total_fare = 0
End Sub
'###############################################
'FORM MODULE CODE TO WORK WITH THE DLL
'###############################################
Dim resp As New calculate.cal
Dim ans As Integer
Private Sub Command1_Click()
Command2_Click
resp.test Text3.Text, Text4.Text, Text1.Text, Text2.Text
Label1.Caption = resp.fare
Label2.Caption = resp.reserve
Label3.Caption = resp.super_fast
End Sub
Public Sub CLEAR()
Label1.Caption = ""
Label2.Caption = ""
Label3.Caption = ""
End Sub
Private Sub Command2_Click()
CLEAR
resp.Reset
End Sub
'N.B:Use all the controls mentioned in the Form Module code to work properly.
No comments have been posted about Use of DLL Component. The code helps to use of DLL files and how to work with it. (From:Prabir Kuma. Why not be the first to post a comment about Use of DLL Component. The code helps to use of DLL files and how to work with it. (From:Prabir Kuma.