- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi friends,
I have written a COM component in Fortran.I am getting an error message while I am calling one of the function of that component in my ASP page.The error message I am getting is
Error Type:
Microsoft VBScript runtime (0x800A000D)
Type mismatch: 'xx'
/fortran/chk.asp, line 11
I am attaching both my fortran code and asp code for better understanding of the problem.
Fortran Code
In my fortran code while I am removing the input input parameter,I am able to get the array value in the asp page.
I will be glad if I will get any suggestion to solve the problem.
Thanks
Debaprasad Tripathy
Timken Engg. And Research India Pvt. Ltd.
I have written a COM component in Fortran.I am getting an error message while I am calling one of the function of that component in my ASP page.The error message I am getting is
Error Type:
Microsoft VBScript runtime (0x800A000D)
Type mismatch: 'xx'
/fortran/chk.asp, line 11
I am attaching both my fortran code and asp code for better understanding of the problem.
Fortran Code
************* ! ! UItestclass.f90 - This file contains the implementation of the ! Itestclass methods ! ! Itestclass_xx function Itestclass_xx( ObjectData ,& y,& x) result (hresult) use testclass_Types use dfwinty use oleaut32 implicit none type(testclass_InstanceData) ObjectData !dec$ attributes reference :: ObjectData TYPE(VARIANT), intent(inout) :: y DIMENSION y(0:2) integer(4), intent(in) :: x integer(LONG) hresult ! TODO: Add implementation call VariantInit(y(0)) y(0)%vt = VT_R8 y(0)%vu%DOUBLE_VAL =1.8 call VariantInit(y(1)) y(1)%vt = VT_R8 y(1)%vu%DOUBLE_VAL =2.6 call VariantInit(y(2)) y(2)%vt = VT_R8 y(2)%vu%DOUBLE_VAL =3.6 * x hresult = S_OK end function ASP code ***********") Response.Write(y(1) & "
") Response.Write(y(2) & "
") %>
In my fortran code while I am removing the input input parameter,I am able to get the array value in the asp page.
I will be glad if I will get any suggestion to solve the problem.
Thanks
Debaprasad Tripathy
Timken Engg. And Research India Pvt. Ltd.
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
The problem is that scripting clients send arrays as a Variant containing a Safearray of Variants. In your code, the interface method is expecting just a SafeArray of Variants. That is your type mismatch.
Once you straighten that out, you'll have to do the fun defensive coding dealing with variant args. Like whether or not the variant was passed with VT_BYREF which affects getting access to the safeArray pointer in the variant. And like whether or not the variant elements of the safearray really are of the type you're expecting. And what method will you use to access the SafeArray of variants in Fortran.
IMO, writing COM code for scripting clients is a pain in the neck, independent of the programming language. FWIW, this gets better in .NET.
hth,
John
The problem is that scripting clients send arrays as a Variant containing a Safearray of Variants. In your code, the interface method is expecting just a SafeArray of Variants. That is your type mismatch.
Once you straighten that out, you'll have to do the fun defensive coding dealing with variant args. Like whether or not the variant was passed with VT_BYREF which affects getting access to the safeArray pointer in the variant. And like whether or not the variant elements of the safearray really are of the type you're expecting. And what method will you use to access the SafeArray of variants in Fortran.
IMO, writing COM code for scripting clients is a pain in the neck, independent of the programming language. FWIW, this gets better in .NET.
hth,
John

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page