主题:vc++中调用Fortran写的dll的问题。
Fortran中的函数:
SUBROUTINE AUSGAB(IARG)
!DEC$ ATTRIBUTES DLLEXPORT : : AUSGAB
implicit none
integer*4 IARG
real*8 EKINE, ANGLE
COMMON/STACK/ E(15),X(15),Y(15),Z(15),U(15),V(15),W(15),DNEAR(15),
*WT(15),IQ(15),IR(15),LATCH(15), LATCHI,NP,NPold
DOUBLE PRECISION E
real*8 X,Y,Z, U,V,W, DNEAR, WT
integer*4 IQ, IR, LATCH, LATCHI, NP, NPold
IF ((IARG .EQ. 3)) THEN
ANGLE=ACOS(W(NP))*180./3.14159
IF ((IQ(NP) .EQ. 0)) THEN
EKINE=E(NP)
ELSE
EKINE=E(NP)-0.511
END IF
WRITE(6,1070)EKINE,IQ(NP),ANGLE
1070 FORMAT(T21,F10.3,T33,I10,T49,F10.1)
END IF
RETURN
END
我做成dll后,在vC++中想要调用这个函数改怎么写啊?帮帮忙啊!
SUBROUTINE AUSGAB(IARG)
!DEC$ ATTRIBUTES DLLEXPORT : : AUSGAB
implicit none
integer*4 IARG
real*8 EKINE, ANGLE
COMMON/STACK/ E(15),X(15),Y(15),Z(15),U(15),V(15),W(15),DNEAR(15),
*WT(15),IQ(15),IR(15),LATCH(15), LATCHI,NP,NPold
DOUBLE PRECISION E
real*8 X,Y,Z, U,V,W, DNEAR, WT
integer*4 IQ, IR, LATCH, LATCHI, NP, NPold
IF ((IARG .EQ. 3)) THEN
ANGLE=ACOS(W(NP))*180./3.14159
IF ((IQ(NP) .EQ. 0)) THEN
EKINE=E(NP)
ELSE
EKINE=E(NP)-0.511
END IF
WRITE(6,1070)EKINE,IQ(NP),ANGLE
1070 FORMAT(T21,F10.3,T33,I10,T49,F10.1)
END IF
RETURN
END
我做成dll后,在vC++中想要调用这个函数改怎么写啊?帮帮忙啊!