- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I use CVF 6.6C on Windows XP pro. I have used the Fortran Module Wizard to generatean AUTO interface/procedure module for a third party application. I have compiled the code I need into a DLL in DEBUG mode and tested it and it works OK, the third party application's object is found and the 3 methods I invoke work Ok and I get the response I want and expect. However, when moving to compile for release, the compiler objects to the wizard module code in respect of all the methods with character arguments passed by reference. The error messages I get are of the following type:
P:EngineersTony RichardsF90DFCODEVusersubLicenseManagermod.f90(163) : Error: The REFERENCE attribute cannot be used with a passed length CHARACTER variable on this platform
SUBROUTINE IIsLicenseMgr_DefineProduct($OBJECT, ProductID, ProductName, MajorVersion, MinorVersion, EncryptionKey, PersistenceKey, $STATUS)
----------------------------------------------------------------------------------------------------------------------------^
The code it is now objecting to in release compilationis as follows:
SUBROUTINE IIsLicenseMgr_DefineProduct($OBJECT, ProductID, ProductName, MajorVersion, MinorVersion, EncryptionKey, PersistenceKey, $STATUS)
!DEC$ ATTRIBUTES DLLEXPORT:: IIsLicenseMgr_DefineProduct
IMPLICIT NONE
INTEGER(INT_PTR_KIND()), INTENT(IN):: $OBJECT ! Object Pointer
!DEC$ ATTRIBUTES VALUE:: $OBJECT
INTEGER, INTENT(IN):: ProductID
!DEC$ ATTRIBUTES REFERENCE:: ProductID
CHARACTER(LEN=*), INTENT(IN):: ProductName! BSTR
!DEC$ ATTRIBUTES REFERENCE:: ProductName
INTEGER, INTENT(IN):: MajorVersion
!DEC$ ATTRIBUTES REFERENCE:: MajorVersion
INTEGER, INTENT(IN):: MinorVersion
!DEC$ ATTRIBUTES REFERENCE:: MinorVersion
CHARACTER(LEN=*), INTENT(IN):: EncryptionKey! BSTR
!DEC$ ATTRIBUTES REFERENCE:: EncryptionKey
CHARACTER(LEN=*), INTENT(IN):: PersistenceKey! BSTR
!DEC$ ATTRIBUTES REFERENCE:: PersistenceKey
INTEGER(4), INTENT(OUT), OPTIONAL:: $STATUS ! Method status
!DEC$ ATTRIBUTES REFERENCE:: $STATUS
INTEGER(4) $$STATUS
INTEGER(INT_PTR_KIND()) invokeargs
invokeargs = AUTOALLOCATEINVOKEARGS()
CALL AUTOADDARG(invokeargs, '$ARG1', ProductID)
CALL AUTOADDARG(invokeargs, '$ARG2', ProductName, AUTO_ARG_IN, VT_BSTR)
CALL AUTOADDARG(invokeargs, '$ARG3', MajorVersion)
CALL AUTOADDARG(invokeargs, '$ARG4', MinorVersion)
CALL AUTOADDARG(invokeargs, '$ARG5', EncryptionKey, AUTO_ARG_IN, VT_BSTR)
CALL AUTOADDARG(invokeargs, '$ARG6', PersistenceKey, AUTO_ARG_IN, VT_BSTR)
$$STATUS = AUTOINVOKE($OBJECT, 17, invokeargs)
IF (PRESENT($STATUS)) $STATUS = $$STATUS
CALL AUTODEALLOCATEINVOKEARGS (invokeargs)
END SUBROUTINE IIsLicenseMgr_DefineProduct
CAn you please advise how this problem arises and how I might get around it?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here is a wrinkle. If I open DevStudio and open the Module Wizard's output file in it and compile ithe modulein release configuration,
the compiler compiles it with no errors! (same with debug con figuration). What's happening?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Well, I have found a solution of sorts, but do not know why it works (or rather, why it failed in the first place).
I built a whole new project, identical to the one I have this problem with, but I added the Module Wizard file as the first file to the project and compiled it inRELEASEconfiguration first. It compiled OK! So I then added all my other files, resources etc. and rebuilt the project in RELEASE configuration and everything went swimmingly, my DLL was rebuilt and I tested it and it worked fine.
It would appear that in my original version of the project (built up over a period of months)something eventually went wrong because of the wizard module's position in compilation order?

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