      subroutine hypo_ew( strn, iresr )
c
c  Subroutine hypo_ew calls Fred Klein's subroutine hypoinv.
c  hypoinv() is the function version of hypoinverse.
c  Subroutine hypo_ew is not a standard part of hypoinverse.
c  It is compiled using Digital Visual FORTRAN, and called
c  by a C function compiled with Microsoft Visual C++.
      character*80 strn
      integer*4 iresr

      integer   strlen
      parameter (strlen=80)
c
c   Local variables
c
      integer i
      character*80 forstr
c
c   Copy the incoming C string to a FORTRAN string
c
      forstr = ' '
c
c      write(6,1000)
c      write(6,1001) iresr
c      write(6,1002) strn
1000  FORMAT ('made it into hypo2000_ew fortran code')
1001  FORMAT ('iresr=', I5)
1002  FORMAT ('str=', A)
      
      do i = 1, strlen
         if ( ichar(strn(i:i)) .eq. 0 ) then
            do j = i, strlen
               forstr(j:j) = ' '
            end do
            goto 10
         end if
         forstr(i:i) = strn(i:i)
      end do
c
c   Call the subroutine version of hypoinverse.
c   iresr contains the result code.
c
10    call hypoinv( forstr, iresr )
c10    call hypoinv( strn, iresr )
c
      return
      end
