|
| |
|
|
BigD
Posts: 116 Joined: 12/27/2002 From: Colorado Springs, CO Status: offline
|
SOLVED!!(Type Mismatch) - 7/8/2003 3:59:04
This is part of the " intranet" project I' m working on. It should work on an " intranet" but will NOT work on the " internet" . This I know! But that' s not my problem but this is! First the insurmountable type mismatch error: Microsoft VBScript runtime error ' 800a000d' Type mismatch: ' Pmt_' /FrontOffice/messing.asp, line 32 Second the Active X DLL: (written by yours truly) Public Function Pmt_(ByVal foRate As Double, ByVal foNPer As Double, ByVal foPV As Double, Optional ByVal foFV As Double = 0, Optional ByVal foDue As Variant = 0) As Double bError = False On Error GoTo e Pmt_ = Pmt(foRate, foNPer, foPV, foFV, foDue) Exit Function e: bError = True Err.Raise vbObjectError + 1, srctag & " PMT_()" , Err.Description End Function Third my VBScript: <% set obj = CreateObject( " frontoffice.fin" ) foFV = 0 foPV = 2400 foRate = 0.099 foNPer = 36 foDue = 0 tmpFld = foFV If Not IsNumeric(tmpFld) Then tmpFld = 0 foFV = cDbl(tmpFld) tmpFld = foPV If Not IsNumeric(tmpFld) Then tmpFld = 0 foPV = cDbl(tmpFld) tmpFld = foRate If Not IsNumeric(tmpFld) Then tmpFld = 0 foRate = cDbl(tmpFld) tmpFld = foNPer If Not IsNumeric(tmpFld) Then tmpFld = 0 foNper = cDbl(tmpFld) tmpFld = foDue If Not IsNumeric(tmpFld) Then tmpFld = 0 foDue = cInt(tmpFld) tmpFld = foPmt_ If Not IsNumeric(tmpFld) Then tmpFld = 0 foPmt_ = cDbl(tmpFld) tmpFld = TotInt If Not IsNumeric(tmpFld) Then tmpFld = 0 TotInt = cDbl(tmpFld) TotInt = Pmt_(foRate / 12, foNPer, foPV * -1, foFV, foDue) ' The infamous Line 32 Response.Write " Your payment will be " & FormatNumber(TotInt,-1,-2,-2,-2) & " a month for this loan." set obj = nothing %> I have tried every to get past the type mismatch, Ive tried placing placing CDbl just about evey place in the dang program. I' ve tried the MS site and tried those suggestions. I' ve tried this in the VBScript Editor and it works fine as it should. When I take the same code and make it a DLL that' s when I come up with the type mismatch. Like I said, this is not for the faint of heart - Any suggestion?? - BigD BTW the answer is 77.32
< Message edited by BigD -- 7/12/2003 7:30:15 PM >
_____________________________
" You Never Know What You' re Going To Find!"
|
|
|
|
Doug G
Posts: 1189 Joined: 12/29/2001 From: SoCal Status: offline
|
RE: Separating the Men From The Boys! (Type Mismatch) - 7/8/2003 12:01:37
Try recoding your activex arguments to variant datatypes. There are some restrictions on what kind of datatypes can flow between COM objects. ASP only supports the " variant" datatype with " subtypes" so anything that flows back to your asp page from your component must be a variant datatype.
_____________________________
====== Doug G ======
|
|
|
|
BigD
Posts: 116 Joined: 12/27/2002 From: Colorado Springs, CO Status: offline
|
RE: Separating the Men From The Boys! (Type Mismatch) - 7/8/2003 13:27:25
In other words, would it be something like this: Public Function Pmt_(ByVal foRate As Variant, ByVal foNPer As Variant, ByVal foPV As Variant, Optional ByVal foFV As Variant = 0, Optional ByVal foDue As Variant = 0) As Variant bError = False On Error GoTo e Pmt_ = Pmt(foRate, foNPer, foPV, foFV, foDue) Exit Function e: bError = True Err.Raise vbObjectError + 1, srctag & " PMT_()" , Err.Description End Function Inquiring minds, you know! - BigD Let me catch the thought pattern on this, the variant type would be initialized when I set my object in the asp page to send to the com. Would I have to reset the types to use them in the function and/or to send them back? I' m a bit lost?? Nope, just tried it, this isn' t the answer, maybe I don' t understand it??
< Message edited by BigD -- 7/8/2003 2:04:31 PM >
_____________________________
" You Never Know What You' re Going To Find!"
|
|
|
|
BigD
Posts: 116 Joined: 12/27/2002 From: Colorado Springs, CO Status: offline
|
RE: Separating the Men From The Boys! (Type Mismatch) - 7/8/2003 20:33:43
I' ve read that about 5 times over. I just can' t make it fit. I know this can be done, wish I could figure it put. This started as an overnight project and is now going on 5 days over one routine. If I keep this up, one of these days I' ll have to get a job!! - BigD
_____________________________
" You Never Know What You' re Going To Find!"
|
|
|
|
Doug G
Posts: 1189 Joined: 12/29/2001 From: SoCal Status: offline
|
RE: Separating the Men From The Boys! (Type Mismatch) - 7/8/2003 23:10:37
Hopefully someone that' s done this often will read this thread. I have only written a couple activex components for fun but not for production.
_____________________________
====== Doug G ======
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|