From: Randall Parker
Antti,
PV, PMT, and IPMT are all functions in Excel. My guess is Basic has the
same functions. So he's not calling out to a different DLL of his own in
this code. He's
probably calling a Microsoft DLL.
Antti Kurenniemi wrote:
> This is probably the code *calling* the DLL. Nothing of any interest is
> happening in this code, it seems like a wrapper class to functionality
> existing somewhere else, so can't really say anything about this snippet.
> The actual DLL (or whatever) can do just about anything - from simple
> calculations to formatting your hard drive. Nothing is really validated here
> one way or the other (nor should it actually be - no point in validating
> variables when you don't see what is being done with the variables).
>
> What's the dll supposed to do?
>
>
> Antti Kurenniemi
>
> "Geo." wrote in message
news:432ee5d9$1{at}w3.nls.net...
>
>>I've got a user who want's a dll file loaded on a web server here, I asked
>>him for the source to the dll so I could see what it's doing and he sent
>>me
>>the below. Since I'm a novice with C++ I figured I'd ask what some of the
>>C
>>types here think of this as far as internet security, it didn't appear to
>>me
>>to have a lot of input checking so passing bad info in order to crash it
>>might be possible but I dunno, would appreciate your opinion.
>>
>>Geo.
>>
>>
>>
>>VERSION 1.0 CLASS
>>BEGIN
>> MultiUse = -1 'True
>> Persistable = 0 'NotPersistable
>> DataBindingBehavior = 0 'vbNone
>> DataSourceBehavior = 0 'vbNone
>> MTSTransactionMode = 0 'NotAnMTSObject
>>END
>>Attribute VB_Name = "ClsFinance"
>>Attribute VB_GlobalNameSpace = False
>>Attribute VB_Creatable = True
>>Attribute VB_PredeclaredId = False
>>Attribute VB_Exposed = True
>>
>>Public Function GetPV(dblRate As Double, dblPer As Double, dblPmt As
>>Double,
>>dblFv As Double)
>>'GetPV = Format(PV(dblRate, dblPer, dblPmt, dblFv), "Currency")
>>GetPV = PV(dblRate, dblPer, dblPmt, dblFv)
>>End Function
>>
>>Public Function GetPmt(dblRate As Double, dblPer As Double, dblPv As
>>Double,
>>dblFv As Double)
>>'GetPmt = Format(Pmt(dblRate, dblPer, dblPV, dblFv), "Currency")
>>GetPmt = Pmt(dblRate, dblPer, dblPv, dblFv)
>>End Function
>>
>>Public Function DoFormat(varExpression As Variant, strFormat As Variant)
>>DoFormat = Format(varExpression, strFormat)
>>End Function
>>
>>Public Function GetIPmt(dblRate As Double, Per As Double, NPer As Double,
>>dblPv As Double, dblFv As Double)
>>GetIPmt = IPmt(dblRate, Per, NPer, dblPv, dblFv)
>>End Function
>>
>>
>>Public Function GetPPmt(dblRate As Double, Per As Double, NPer As Double,
>>dblPv As Double, dblFv As Double)
>>GetPPmt = PPmt(dblRate, Per, NPer, dblPv, dblFv)
>>
>>End Function
>>
>>Public Function GetNextIR(dblCurRate As Double, dblMargin As Double,
>>dblIndex As Double, dblMaxRate As Double, dblMinRate As Double,
>>dblMaxChange
>>As Double)
>>
>>If (dblCurRate
dblMaxChange)
>>Then
>> GetNextIR = dblCurRate + dblMaxChange
>> Exit Function
>>End If
>>
>>If (dblCurRate > dblMaxRate) And (dblCurRate - dblMaxRate >
dblMaxChange)
>>Then
>> GetNextIR = dblCurRate - dblMaxChange
>> Exit Function
>>End If
>>
>>If Abs(dblCurRate - (dblMargin + dblIndex)) > dblMaxChange Then
>> If dblCurRate < dblMargin + dblIndex Then
>> If dblCurRate + dblMaxChange > dblMaxRate Then
>> GetNextIR = dblMaxRate
>> Exit Function
>> Else
>> GetNextIR = dblCurRate + dblMaxChange
>> Exit Function
>> End If
>> Else
>> If dblCurRate - dblMaxChange < dblMinRate Then
>> GetNextIR = dblMinRate
>> Exit Function
>> Else
>> GetNextIR = dblCurRate - dblMaxChange
>> Exit Function
>> End If
>> End If
>>Else
>> If dblMargin + dblIndex > dblMaxRate Then
>> GetNextIR = dblMaxRate
>> Exit Function
>> Else
>> If dblMargin + dblIndex < dblMinRate Then
>> GetNextIR = dblMinRate
>> Exit Function
>> Else
>> GetNextIR = dblIndex + dblMargin
>> End If
>> End If
>>End If
>>
>>
>>End Function
>>
>>
>
>
>
--- BBBS/NT v4.01 Flag-5
* Origin: Barktopia BBS Site http://HarborWebs.com:8081 (1:379/45)
SEEN-BY: 633/267 270 5030/786
@PATH: 379/45 1 106/2000 633/267
|