- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am a complete novice as far as C++ is concerned, so having great difficulty with interfacing my Fortran and C++ codes:
On the Fortran side:
INTERFACE
SUBROUTINE HASHSTRING (str_in, str_in_len, str_out, str_out_len, Status) BIND(C)
USE,INTRINSIC :: ISO_C_BINDING ! Declares C kinds
USE IFWIN, ONLY : DWORD
CHARACTER(KIND=C_CHAR),DIMENSION(*) :: str_in,str_out
INTEGER(C_INT), VALUE, INTENT(IN) :: str_in_len, str_out_len
INTEGER(DWORD), INTENT(INOUT) :: Status
END SUBROUTINE HASHSTRING
END INTERFACE
On the C++
extern "C" void hashstring (
char* MyString,
int MyStringLen,
char* encHash,
int encHasHLen,
DWORD dwStatus)
Everything is working except returning the Status. Even though when in debug mode, this has a value of 0 in the cpp routine, when I get back to Fortran, it has the value it had before the call.
SOLVED it myself -- needed & on the dwStatus argument.
Thanks,
David
Link Copied

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page