Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29249 ディスカッション

Re: Calling a DLL routine from CVF

Jugoslav_Dujic
高評価コントリビューター II
413件の閲覧回数
1) Use dumpbin /exports 3rdparty.dll to see what is the real exported name from the dll (case matters). If it's _GetIteration, it's probably C calling convention; if it's _GetIteration@36, that's STDCALL; if it's unmangled, your guess is as good as mine.

2) Write INTERFACE block for it in your code:
INTERFACE
  SUBROUTINE GetIteration(argument-list)
  !DEC$ATTRIBUTES STDCALL, ALIAS: "_GetIteration@36" :: GetIteration
!declare argument list here
  END SUBROUTINE
END INTERFACE
. Replace STDCALL with C and aliased name above as necessary.

3) Do you have 3rdparty.lib supplied with the dll?
3a) If you do, insert it into your project and that's about all.
3b) If you don't, you'll have to load the Dll dynamically using LoadLibrary/GetProcAddress. See LOADEXP1 sample in CVF samples or search this Forum for "GetProcAddress".

Good Luck
Jugoslav
0 件の賞賛
0 返答(返信)
返信