Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28501 Discussions

ERROR 49 BAD DLL CALLING CONVENTION FROM VBA

Guaglardi__Paul
Beginner
2,270 Views

Code behind excel that has been successfully used before to call a DLL yields a new error, Error 49.  Have tried several variations including PTRsafe as well as removing the "alias".  Any ideas out there?

0 Kudos
22 Replies
FortranFan
Honored Contributor II
219 Views

Steve Lionel (Ret.) wrote:

It's not a mystery to me - it would have worked as-is with CVF.

Looking at this page https://software.intel.com/en-us/fortran-compiler-18.0-developer-guide-and-reference-attributes-cvf#58E6D2C7-1404-4AA8-BE8E-649E30BB32A5. I would think the code in Quote #7 had !DEC$ compiler directives with STDCALL and perhaps REFERENCE attribute also for it to have worked previously with Excel.  And that with such directives included, the code would then continue to work as-is with Intel Fortran, no?

 

0 Kudos
Steve_Lionel
Honored Contributor III
219 Views

Would also need ALIAS and DECORATE because STDCALL downcases the name, but with those, yes. The Excel declaration matches exactly what CVF would generate by default.

0 Kudos
Reply