ComCreateObject

ComCreateObject

I have created activeX dll (HGC_TestFortran.dll) with VB containing a method (SUM)that makes the sum of two values. The sum is returned.

Public Sub Sum(ByVal X As Long, ByVal Y As Long, ByRef lSum As Long)

lSum = X + Y

End Sub

I have used the "Fortran Module Wizard" to generate the interface between fortran and the activex dll. I have used "Type library containing COM interface information".

My fortran project looks as follow:

USE TestSumRet

implicit none

integer*4 object, nstatus, lsum
integer*4 status

CALL COMInitialize (status)
CALL COMCREATEOBJECT ("HGC_TestFortran.TestFortran", object, nstatus)

! 100 and 1224 are the input parameters of my
! method SUM
! lSum is the sum
call $$TestFortran_Sum(object, 100, 1224, lSum)

print *, lsum

end program SumTwoNumbers

This program looks fine and after running, 1324 is displayed.

However, when I put my dll (HGC_TestFortran.dll) in COM+, then the program doesn't work anymore. The result is now 0.
Do you now what the problem could be?

Attached you'll find the code created by the "Fortran Module Wizard"

Best regards,
Hilde

1 post / 0 new
For more complete information about compiler optimizations, see our Optimization Notice.