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...
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...
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...
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...
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
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...
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...
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...
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...
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]
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.
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...
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...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.