locked
Dll file writing problem RRS feed

  • Question

  • I have a question related to the debugging of Dll file in visual studio 2010. I have created a new project and I have a writing statemenet in the Dll file in which I want to write specific output to specific file with specific path. I debug and the the code is ruuning but there is no output file, so why it does not write output with dll file while it writes output if I use fortran file instead of dll file? Is there specific procedure to get output from dll files in visual studio 2010 ?
    Sunday, August 9, 2020 6:20 PM

All replies

  • Maybe the code is incorrect. Show some details.

    Sunday, August 9, 2020 6:25 PM
  • I have fortran file in which I have writing statement. I have released this fortran file using dynamic library to create dll file from it. Then, I have created new project in which I have added this dll file and debug. The code is running correctly but the writing statement is not working. I can not see any output file. I use this writing statement: OPEN(120,FILE='C:\Newfile\XYZ.TXT')

    Write(120,*) T,Q(1:3) 

    Monday, August 10, 2020 3:37 AM
  • Hello Eldeeb,

    I need to confirm something with you.

    How do you include, import and use functions(statement) of the dll(fortran) file? Which kind of project and programming language do you use in your new project to try to use the dll(fortran) file?

    Since it writes output if you use fortran file instead of dll file, this issue should be caused by the way you import and use the dll(fortran) file, or the way you package the fortran file to dll file.

    If possible, could you share the reproduced steps with me, and I will follow these steps to test on my side.

    This “Visual Studio General Questions” forum is being migrated to a new home on Microsoft Q&A, please refer to this sticky post for more details.

    Feel free to contact me.

    Best Regards,

    Tianyu


    Visual Studio forum is being migrated to a new home on Microsoft Q&A (Preview)!
    We invite you to post new questions in the "Visual Studio" forum’s new home on Microsoft Q&A (Preview)!
    For more information, please refer to the sticky post.


    Tuesday, August 11, 2020 3:34 AM
  • Hello Eldeeb,

    Not get your reply for several days, does this issue still persist?

    Could you share more information with me, and this will be useful for me to check.

    Looking forward to hearing from you.

    Kind Regards,

    Tianyu


    Visual Studio forum is being migrated to a new home on Microsoft Q&A (Preview)!
    We invite you to post new questions in the "Visual Studio" forum’s new home on Microsoft Q&A (Preview)!
    For more information, please refer to the sticky post.

    Friday, August 14, 2020 8:44 AM
  • Hi Tinayu,

    I use this for program to link two dll files together to create a txt file in a specified directory. However, I see there is a problem in reading the two dll files using this program. 

          program main
          use kernel32
          integer(handle) lib_handle
          integer(handle) user_handle
          pointer(SAMSDLLPNT,SAMSDLL)
          user_handle = LoadLibrary("C:/Users/Ahmed/Desktop/Dll problem/
         + AHMED2020/SamsUser.dll"C)
          lib_handle = LoadLibrary("C:/Users/Ahmed/Desktop/Dll problem/
         + AHMED2020/SamsIF.dll"C)
          if (lib_handle == 0) stop "Library not loaded"
          SAMSDLLPNT = GetProcAddress(lib_handle, "SAMSDLL"C)
          if (SAMSDLLPNT == 0) stop "SAMSDLL subroutine not found"
          call SAMSDLL
          end program

    Saturday, August 15, 2020 2:04 AM
  • Hi Tinayu,

    I use this for program to link two dll files together to create a txt file in a specified directory. However, I see there is a problem in reading the two dll files using this program. 

          program main
          use kernel32
          integer(handle) lib_handle
          integer(handle) user_handle
          pointer(SAMSDLLPNT,SAMSDLL)
          user_handle = LoadLibrary("C:/Users/Ahmed/Desktop/Dll problem/
         + AHMED2020/SamsUser.dll"C)
          lib_handle = LoadLibrary("C:/Users/Ahmed/Desktop/Dll problem/
         + AHMED2020/SamsIF.dll"C)
          if (lib_handle == 0) stop "Library not loaded"
          SAMSDLLPNT = GetProcAddress(lib_handle, "SAMSDLL"C)
          if (SAMSDLLPNT == 0) stop "SAMSDLL subroutine not found"
          call SAMSDLL
          end program
    Sunday, August 16, 2020 2:49 PM
  • Hello Eldeeb,

    It seems there is something wrong with this program, since this program is related to Fortran, I recommend you redirect to Stack Overflow tagged with fortran, and start a new thread there to seek for a more professional help.

    Best Regards,

    Tianyu


    Visual Studio forum is being migrated to a new home on Microsoft Q&A (Preview)!
    We invite you to post new questions in the "Visual Studio" forum’s new home on Microsoft Q&A (Preview)!
    For more information, please refer to the sticky post.


    Tuesday, August 18, 2020 10:15 AM