/****************** PKDLL.cpp ********************/
// PKDDL.cpp : Defines the entry point for the DLL application.
//
#include "stdafx.h"
#include "math.h"
BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
return TRUE;
}
double _stdcall berij(double x,double y)
{
return x+y;
}
double _stdcall vajabaki(double x,double y)
{
return x-y;
}
double _stdcall gunakar(double x,double y)
{
return x*y;
}
double _stdcall bhagakar(double x,double y)
{
return x/y;
}
double _stdcall logicaland(long x,long y)
{
return x & y;
}
double _stdcall logicalor(long x,long y)
{
return x | y;
}
double _stdcall logicalxor(long x,long y)
{
return (x & (~y)) | (y & (~x));
}
double _stdcall modd(long x,long y)
{
return x % y;
}
double _stdcall xchay(double x,double y)
{
return(pow(x,y));
}
double _stdcall xchaydon(double x)
{
return(pow(x,2));
}
double _stdcall xchayteen(double x)
{
return(pow(x,3));
}
double _stdcall xchaynimma(double x)
{
return(pow(x,0.5));
}
double _stdcall xchaytippat(double x)
{
return(pow(x,0.3333333333333333333333333333333334));
}
double _stdcall onebyx(double x)
{
return(1/x);
}
double _stdcall xfact(double x)
{
int i,j;
j=1;
for(i=1;i<=x;i++)
j=i*j;
return(j);
}
double _stdcall echax(double x)
{
return(pow(2.71828,x));
}
double _stdcall xsindeg(double x)
{
return(sin(x*0.01745555555555555555555555555556));
}
double _stdcall xcosdeg(double x)
{
return(cos(x*0.01745555555555555555555555555556));
}
double _stdcall xtandeg(double x)
{
return(tan(x*0.01745555555555555555555555555556));
}
double _stdcall xlog(double x)
{
return(log(x));
}
double _stdcall xlogten(double x)
{
return(log10(x));
}
double _stdcall xsinrad(double x)
{
return(sin(x));
}
double _stdcall xcosrad(double x)
{
return(cos(x));
}
double _stdcall xtanrad(double x)
{
return(tan(x));
}
/******************* PKDLL.def *******************/
LIBRARY PKDDL
EXPORTS
berij @1
vajabaki @2
gunakar @3
bhagakar @4
logicaland @5
logicalor @6
logicalxor @7
modd @8
xchay @9
xchaydon @10
xchayteen @11
xchaynimma @12
xchaytippat @13
onebyx @14
echax @15
xfact @16
xsindeg @17
xcosdeg @18
xtandeg @19
xsinrad @20
xcosrad @21
xtanrad @22
xlog @23
xlogten @24
/******************** calci.vbp ********************/
Dim op As Integer
Dim a As Variant
Private Declare Function berij Lib "C:\TE-A-37\PKDDL\PKDDL\Debug\PKDDL.dll" (ByVal X As Double, ByVal Y As Double) As Double
Private Declare Function vajabaki Lib "C:\TE-A-37\PKDDL\PKDDL\Debug\PKDDL.dll" (ByVal X As Double, ByVal Y As Double) As Double
Private Declare Function gunakar Lib "C:\TE-A-37\PKDDL\PKDDL\Debug\PKDDL.dll" (ByVal X As Double, ByVal Y As Double) As Double
Private Declare Function bhagakar Lib "C:\TE-A-37\PKDDL\PKDDL\Debug\PKDDL.dll" (ByVal X As Double, ByVal Y As Double) As Double
Private Declare Function logicaland Lib "C:\TE-A-37\PKDDL\PKDDL\Debug\PKDDL.dll" (ByVal X As Long, ByVal Y As Long) As Double
Private Declare Function logicalor Lib "C:\TE-A-37\PKDDL\PKDDL\Debug\PKDDL.dll" (ByVal X As Long, ByVal Y As Long) As Double
Private Declare Function logicalxor Lib "C:\TE-A-37\PKDDL\PKDDL\Debug\PKDDL.dll" (ByVal X As Long, ByVal Y As Long) As Double
Private Declare Function modd Lib "C:\TE-A-37\PKDDL\PKDDL\Debug\PKDDL.dll" (ByVal X As Long, ByVal Y As Long) As Double
Private Declare Function xchay Lib "C:\TE-A-37\PKDDL\PKDDL\Debug\PKDDL.dll" (ByVal X As Double, ByVal Y As Double) As Double
Private Declare Function xchaydon Lib "C:\TE-A-37\PKDDL\PKDDL\Debug\PKDDL.dll" (ByVal X As Double) As Double
Private Declare Function xchayteen Lib "C:\TE-A-37\PKDDL\PKDDL\Debug\PKDDL.dll" (ByVal X As Double) As Double
Private Declare Function xchaynimma Lib "C:\TE-A-37\PKDDL\PKDDL\Debug\PKDDL.dll" (ByVal X As Double) As Double
Private Declare Function xchaytippat Lib "C:\TE-A-37\PKDDL\PKDDL\Debug\PKDDL.dll" (ByVal X As Double) As Double
Private Declare Function onebyx Lib "C:\TE-A-37\PKDDL\PKDDL\Debug\PKDDL.dll" (ByVal X As Double) As Double
Private Declare Function echax Lib "C:\TE-A-37\PKDDL\PKDDL\Debug\PKDDL.dll" (ByVal X As Double) As Double
Private Declare Function xfact Lib "C:\TE-A-37\PKDDL\PKDDL\Debug\PKDDL.dll" (ByVal X As Double) As Double
Private Declare Function xsindeg Lib "C:\TE-A-37\PKDDL\PKDDL\Debug\PKDDL.dll" (ByVal X As Double) As Double
Private Declare Function xcosdeg Lib "C:\TE-A-37\PKDDL\PKDDL\Debug\PKDDL.dll" (ByVal X As Double) As Double
Private Declare Function xtandeg Lib "C:\TE-A-37\PKDDL\PKDDL\Debug\PKDDL.dll" (ByVal X As Double) As Double
Private Declare Function xsinrad Lib "C:\TE-A-37\PKDDL\PKDDL\Debug\PKDDL.dll" (ByVal X As Double) As Double
Private Declare Function xcosrad Lib "C:\TE-A-37\PKDDL\PKDDL\Debug\PKDDL.dll" (ByVal X As Double) As Double
Private Declare Function xtanrad Lib "C:\TE-A-37\PKDDL\PKDDL\Debug\PKDDL.dll" (ByVal X As Double) As Double
Private Declare Function xlog Lib "C:\TE-A-37\PKDDL\PKDDL\Debug\PKDDL.dll" (ByVal X As Double) As Double
Private Declare Function xlogten Lib "C:\TE-A-37\PKDDL\PKDDL\Debug\PKDDL.dll" (ByVal X As Double) As Double
Private Sub Command1_Click(Index As Integer)
If (Index <> 10) Then
Text1.Text = Text1.Text & Index
Else
Text1.Text = Text1.Text & "."
End If
End Sub
Private Sub Command2_Click(Index As Integer)
a = Val(Text1.Text)
Select Case Index
Case 8: Text1.Text = xchaydon(a)
GoTo baher
Case 9: Text1.Text = xchayteen(a)
GoTo baher
Case 10: Text1.Text = xchaynimma(a)
GoTo baher
Case 11: Text1.Text = xchaytippat(a)
GoTo baher
Case 12: Text1.Text = onebyx(a)
GoTo baher
Case 14: Text1.Text = xfact(a)
GoTo baher
Case 15: Text1.Text = echax(a)
GoTo baher
Case 16:
If (Option1.Value = True) Then
Text1.Text = xsindeg(a)
Else
Text1.Text = xsinrad(a)
End If
GoTo baher
Case 17:
If (Option1.Value = True) Then
Text1.Text = xcosdeg(a)
Else
Text1.Text = xcosrad(a)
End If
GoTo baher
Case 18:
If (Option1.Value = True) Then
Text1.Text = xtandeg(a)
Else
Text1.Text = xtanrad(a)
End If
GoTo baher
Case 19: Text1.Text = xlog(a)
GoTo baher
Case 20: Text1.Text = xlogten(a)
GoTo baher
Case 21: Text1.Text = 3.142
GoTo baher
Case 22: Text1.Text = (-1) * a
GoTo baher
End Select
op = Index
Text1.Text = ""
baher:
End Sub
Private Sub Command3_Click()
Select Case op
Case 0: Text1.Text = berij(a, Val(Text1.Text))
Case 1: Text1.Text = vajabaki(a, Val(Text1.Text))
Case 2: Text1.Text = gunakar(a, Val(Text1.Text))
Case 3: Text1.Text = bhagakar(a, Val(Text1.Text))
Case 4: Text1.Text = logicaland(a, Val(Text1.Text))
Case 5: Text1.Text = logicalor(a, Val(Text1.Text))
Case 6: Text1.Text = logicalxor(a, Val(Text1.Text))
Case 7: Text1.Text = modd(a, Val(Text1.Text))
Case 13: Text1.Text = xchay(a, Val(Text1.Text))
End Select
End Sub
Private Sub Command4_Click()
Text1.Text = ""
End Sub
Private Sub Command5_Click()
Text1.Text = Left(Text1.Text, Len(Text1.Text) - 1)
End Sub
Private Sub Text1_Change()
Text1.Locked = True
End Sub
/***************** Form Design *****************/
No comments:
Post a Comment