Compaq Visual Fortran VB6 dll 
Author Message
 Compaq Visual Fortran VB6 dll

Hello,

    I have created a fortran dll program under Compaq Visual Fortran. I am
calling this from a VB6 program. ( See partial listings).

    When I run the VB program I get "Sub or function not defined" error.
Why? Where am I doing wrong. Thank you.

Athena

---------------------------------------------------------

Fortran  Program:

!  DunnettTukey.f90
!
!  FUNCTIONS/SUBROUTINES exported from DunnettTukey.dll:
! DunnettTukey      - subroutine
!
  module comm

  real, dimension(:,:),allocatable::vc,hm,p,c,gg,vcc
  integer k,k1,ndenom,lines,mocar,irep,mm,notempty,icontrol
  real zero,zone,two,zoneplus,sx,ssx,zrep,coc,sd,zmean,se
  real brakl,braku,conf,xacc,seed,givense,zmocar
  parameter (mr=714025,ia=1366,ic=150889,rm=1./mr)

 end module comm

! Program Dunnett-Tukey Critical Values

Subroutine DunnettTukey(iType,r,df,Alpha,CritValue)

!DEC$ ATTRIBUTES DLLEXPORT::DunnettTukey
!DEC$ ATTRIBUTES ALIAS:"DunnettTukey"::DunnettTukey

 use comm

 integer,intent(in)::r
 integer,intent(in)::df
 integer,intent(in)::iType
 real,intent(in)::Alpha
 real,intent(OUT)::CritValue

 conf=Alpha
 ndenom=df
 k=r

 call DBatch(iType,iseed1)
 CritValue=zmean

 return

end subroutine DunnettTukey

Subroutine DBatch(swtype,iseed1)
.........

VB6 Program form:

Option Explicit

Dim CritValue As Single
Dim r As Integer
Dim df As Integer
Dim iType As Integer
Dim Alpha As Single

Private Sub cmdCalc_Click()

    df = CInt(txtdf.Text)
    r = CInt(txtr.Text)

    Call DunnettTukey(iType, r, df, Alpha, CritValue)

    txtCritValue = CritValue

End Sub

VB6 Bas Module:

Declare Sub DunnnettTukey Lib "c:\windows\system32\DunnettTukey.dll" (iType
As Long, r As Long, df As Long, Alpha As Single, CritValue As Single)



Sat, 04 Apr 2009 09:35:55 GMT  
 Compaq Visual Fortran VB6 dll

Quote:

> Hello,

>     I have created a Fortran dll program under Compaq Visual Fortran. I am
> calling this from a VB6 program. ( See partial listings).

>     When I run the VB program I get "Sub or function not defined" error.
> Why? Where am I doing wrong. Thank you.

I think you get that error if there is a missing dependency for the dll,
which will happen if you build with default settings (which use the dll
version of the Fortran runtime) and attempt to run on a machine where
the CVF runtime dll is not installed.

You can diagnose this using Dependency Walker on the Fortran dll.



Sun, 05 Apr 2009 00:13:48 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Creating - Fortran 77 dll for use in Visual Basic 6.0 (not using Compaq Visual Fortran)

2. Building DLLs with Compaq Visual Fortran and Intel Visual Fortran

3. Compaq Visual FORTRAN and VB6.0

4. Mixing Compaq Visual Fortran 6 with Microsoft Visual C++ .NET

5. Question on using Compaq Visual FORTRAN with Microsoft Visual C++ 6.0

6. Compaq Visual Fortran or Intel Fortran Compiler?

7. Compaq visual fortran and Watcom fortran

8. Interface Visual Fortran and VB6

9. Calling Fortran DLL with char args from VB6

10. Importing VB6 code to VB.NET calling FORTRAN .DLL lessons learned

11. call Fortran DLL from VB6

12. compag visual fortran dll callable from visual basic 6

 

 
Powered by phpBB® Forum Software