Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
The Intel sign-in experience is changing in February to support enhanced security controls. If you sign in, click here for more information.
27551 Discussions

ERROR 49 BAD DLL CALLING CONVENTION FROM VBA

Guaglardi__Paul
Beginner
756 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
39 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#.... 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?

 

Steve_Lionel
Black Belt Retired Employee
39 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.

Reply