- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi friends,
I am facing a casting problem in my COM server code.Can anyone help me.I am attaching my code below.
function Itestcmptfreq_testing( ObjectData ,&
x,&
y) result (hresult)
use testcmptfreq_Types
use dfcom
implicit none
type(testcmptfreq_InstanceData) ObjectData
!dec$ attributes reference :: ObjectData
REAL(8), intent(in) :: x
type(variant), intent(out) :: y
integer(LONG) hresult
integer*4 status
! TODO: Add implementation
status=variantchangetype(y,y,0,VT_R8)
y=x------------->>>HERE I AM GETTING ERROR
hresult = S_OK
end function
I am facing a casting problem in my COM server code.Can anyone help me.I am attaching my code below.
function Itestcmptfreq_testing( ObjectData ,&
x,&
y) result (hresult)
use testcmptfreq_Types
use dfcom
implicit none
type(testcmptfreq_InstanceData) ObjectData
!dec$ attributes reference :: ObjectData
REAL(8), intent(in) :: x
type(variant), intent(out) :: y
integer(LONG) hresult
integer*4 status
! TODO: Add implementation
status=variantchangetype(y,y,0,VT_R8)
y=x------------->>>HERE I AM GETTING ERROR
hresult = S_OK
end function
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
The VARIANT data type is a system defined data type, and not one that Fortran knows about. A VARIANT contains an indication of the type of value contained in the VARIANT (the vt field) and the value. The value field is actually a union of all possible values.
For an output VARIANT, you must initialize it with the right type and value. Here is an example:
call VariantInit(y)
y%vt = VT_R8
y%vu%DOUBLE_VAL = x
Leo
The VARIANT data type is a system defined data type, and not one that Fortran knows about. A VARIANT contains an indication of the type of value contained in the VARIANT (the vt field) and the value. The value field is actually a union of all possible values.
For an output VARIANT, you must initialize it with the right type and value. Here is an example:
call VariantInit(y)
y%vt = VT_R8
y%vu%DOUBLE_VAL = x
Leo

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