replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - Calling .NET methods from FTN95 with enums
forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Calling .NET methods from FTN95 with enums

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
Ade



Joined: 20 Jul 2010
Posts: 6

PostPosted: Thu Sep 16, 2010 5:01 pm    Post subject: Calling .NET methods from FTN95 with enums Reply with quote

The code below gives error 1119 - No .NET method matches this call.



Code:

      SUBROUTINE TESTIT(MDL)
C
      LIBRARY("MTSL.Data.dll")
      ASSEMBLY_EXTERNAL(NAME="MTSL.Data.Model.Count") MODELCOUNT
C     
      OBJECT("MTSL.Data.Model") MDL
      CHARACTER(LEN=24),PARAMETER::OBJECTTYPE="MTSL.Data.MTSLObjectType"
C
      INTEGER*4 NUM
C     
      NUM = MODELCOUNT(MDL, OBJECTTYPE%otPoint)
C
      WRITE(*,*) NUM
C
      RETURN           
      END


MTSL.Data.dll was written with C#. The class 'Model' has a method 'Count' that takes an enum as a parameter to return the number of items of that type. An instance of a 'Model' is passed to the FTN95 routine.
_________________
Adrian Paveling
Systems Developer
McCarthy Taylor Systems Ltd

www.dtmsoftware.com
Back to top
View user's profile Send private message
silverfrost
Site Admin


Joined: 29 Nov 2006
Posts: 193
Location: Manchester

PostPosted: Mon Oct 04, 2010 2:38 pm    Post subject: Reply with quote

I am assuming here that otPoint is an enum value? How is it declared (jn the C#)?
Back to top
View user's profile Send private message Visit poster's website
Ade



Joined: 20 Jul 2010
Posts: 6

PostPosted: Fri Oct 08, 2010 10:40 am    Post subject: Reply with quote

C# declaration of enum MTSLObjectType in MTSL.Data.dll -

Code:

   /// <summary>
   /// An enumeration to identify MTSL object types.
   /// </summary>
   public enum MTSLObjectType
   {
      otDataObject,
      otAttribObject,
      otRefObject,
      otAttribRefObject,

      // Main data types...

      otStation,
      otSetup,
      otObservation,
      otControl,
      otPoint,
      otTriangle,
      otLink,
      otText,

      // Main survey types...

      otModel,

      // Add new types below...

      otNonTerrainNode,
      otLoadFile,
      otPointCode,
      otLinkCode,
      otSurfaceCode,
      otLegend,
      otModelDisplay
   }


Declaration of Method Model.Count in MTSL.Data.dll -

Code:

   /// <summary>
   /// Summary description for ModelClass.
   /// </summary>
   public class Model : MTSLAttributeDataObject
   {
...
...
        public int Count(MTSLObjectType ObjectType)
        {
            ArrayList arr = GetList(ObjectType);
            if (arr == null) return 0;

            return arr.Count; 
        }

        public ArrayList GetList(MTSLObjectType ObjectType)
        {
            switch (ObjectType)
            {
                case MTSLObjectType.otStation: return (ArrayList)FData[2];
                case MTSLObjectType.otSetup: return (ArrayList)FData[3];
                case MTSLObjectType.otControl: return (ArrayList)FData[4];
                case MTSLObjectType.otObservation: return (ArrayList)FData[5];
                case MTSLObjectType.otPoint: return (ArrayList)FData[6];
                case MTSLObjectType.otLink: return (ArrayList)FData[7];
                case MTSLObjectType.otTriangle: return (ArrayList)FData[8];
                case MTSLObjectType.otText: return (ArrayList)FData[9];
                case MTSLObjectType.otNonTerrainNode: return (ArrayList)FData[16];
                case MTSLObjectType.otLoadFile: return (ArrayList)FData[17];

                default: return null;
            }
        }
...
...
    }


_________________
Adrian Paveling
Systems Developer
McCarthy Taylor Systems Ltd

www.dtmsoftware.com
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group