Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. Phil31

    Real Number to character

    You cannot change the type of a variable. If you want to convert a real variable to a character variable you need to use for example a write statement like: write(string,*) x (supposed that string is long enough to contains the value of the variable). you can also use a formatted write such...
  2. Phil31

    fortran dll and vba problem

    Take a look at thread thread214-773921
  3. Phil31

    Fortran EXE Cannot Find Fortran DLL

    first of all the declaration in your main program should be: !DEC$ ATTRIBUTES DLLIMPORT :: VISC secondly I think it is not necessary to create an empty program in your dll, you can include only exported functions and you need to add the import library created along with your dll to your EXE...
  4. Phil31

    Getting Username?

    Just use the GETLOG subroutine from the Portability library as in the following code: use DFPORT ... character(256) name call GETLOG(name) ...
  5. Phil31

    Fortran program calling C subroutine. How do I compile??

    Hi Kirk, I don't know about Intel fortan but I think that you have to declare that the function falloc_ you want to call uses the c calling convention. This can be don by declaring an explicit interface to this function and stating that this functions uses the c calling convention. In Compaq...
  6. Phil31

    Excel vba and Fortran dlls

    Presious message continued May be you also forget do export the entry point of your dll subroutine. A more complete declaration would be : !dec$ attributes stdcall, alias: 'VBAtest', dllexport :: VBAtest !dec$ attributes reference :: arg1, arg2 I don't know how to match theses rules with...
  7. Phil31

    Excel vba and Fortran dlls

    I Giggi, I think you forget to declare the stdcall calling convention on fortran side and to pass arguments by references. In Compaq visual fortran this declared as follows (as in my previous message). !dec$ attributes stdcall :: VBAtest !dec$ attributes refrence :: arg1, arg2 ;-) - Phil31
  8. Phil31

    help with I/O problem

    Hi, try to use the ADVANCE='NO' option in the READ statement. for example : CHARACTER(1) Car .../... OPEN(10,FILE=.....) .../... READ(10,'(A)',ADVANCE='NO') Car .../... Nevertheless you need to detect the end of the line (by checking the value of Car). You will find more...
  9. Phil31

    Excel vba and Fortran dlls

    Hi, Did you use the STDCALL naming convention on both sides ? Anyway, remember that Fortran passes arguments by reference and STDCALL naming convention passes arguments by value, So you need to add a !DEC$ ATTRIBUTES REFRENCE :: declaration on Fortran side for arguments passed by ref (Visual...
  10. Phil31

    Need examples of calling VB.dll from Fortran

    Hi, It is not necessary to use COM to call external DLLs from fortran code. I have some experience and I have already used fortran code that called Delphi functions so I suppose that calling VB DLLs is not very different. You need to take care about the naming conventions used in both codes but...
  11. Phil31

    variable extensions: file.dat_//string

    simply create your datafile name from a write statement: character*12 fnName write(fnName,'(A,I2.2)') 'hello.dat_',timer open(1, file=fnName) do t=1,10 .... write(1,*) ... end do your filenames should look like: hello.dat_01, hello.dat_02,.... you can also use different format if you...
  12. Phil31

    Command that returns current directory?

    If you are using Windows, you can use the GetCurrentDirectory API function. For example : USE DFWIN ... CHARACTER(512) CurDirStr INTEGER(4) lrc ... lrc = GetCurrentDirectory(LEN(CurDirStr), CurDirStr) PRINT *, CurDirStr(1:lrc) [thumbsup]
  13. Phil31

    Compaq Visual Fortran's array bound check.

    Open the project settings, go to the Fortran Tab, select Run time catagory and uncheck the box corresponding to the option Array & string bounds in group Entended Error Checking that's all.
  14. Phil31

    Calling a Fortran Dll on a machine without Fortran installed

    Hi all, may be I am two late but I think you can find information on the necesary runtime libraries (dlls) on the following topic in Visual Studio : Visual Fortran/Visual C++ Mixed-Language Program. This section explains what are the required dlls depending on the compiler options you have...
  15. Phil31

    Sharing files between DLLs

    I cannot solve the following problem: I have a DLL dll_1 that opens a file for output, this DLL calls another DLL dll_2 (using Loadlibrary, GetProcAdress,...) and if I use use the same logical unit for output in dll_2, I get a file fort.x (x being the logical unit number). I don't want that...
  16. Phil31

    coutning characters in a string

    Depending on your fortran implementation and OS, you could sometime find special functions like LNBLNK or LEN_TRIM that returns the length of a string passed as argument wihtout couting the trailling blanks. These functions exists in VisualFortran and UNIX (for LNBLNK).
  17. Phil31

    Entry point into *.dll

    The following code will do what you want. VBA code: Declare Function GETPI Lib "GETPI" (X As Double) As Double Function GetPiValue(arg As Variant) As Double Dim X As Double X = arg GetPiValue = GETPI(X) End Function Fortran code: REAL*8 FUNCTION GetPI(X) !DEC$...
  18. Phil31

    Entry point into *.dll

    Please find hereafter an axample of a VBA code calling a Fortran DLL that returns the value of PI. VBA code: Declare Function GETPI Lib "GETPI" () As Double Function GetPiValue() As Double GetPiValue = GETPI() End Function Fortran code: REAL*8 FUNCTION GetPI() !DEC$...
  19. Phil31

    Excel and FORTRAN

    You need to use fortran DLLs with STDCALL calling convention.
  20. Phil31

    new question: generate system even in Fortran?

    May be you can use the SendMessage or PostMessage function (windows API) to send previously registred message(s) to the calling process. I work with this since several years with Delphi GUI applications that calls fortran DLLs and when i want that the GUI refresh values i use the SendMessage...

Part and Inventory Search

Back
Top