0 Replies Latest reply on Apr 14, 2010 6:41 AM by ToBeNamedLater

    Enum access in .NET assemblies


      I've run out of ideas.


      I'm trying to call a function in a .NET DLL that uses as one of its parameters, an enumerated value.


      The specific code is:


      <cfobject action="create" type=".net" name="Enum_MessageID"  class="Quiksoft.EasyMail.IMAP4.MessageID"  assembly="#assembly_path#" />
      <cfdump var="#Enum_MessageID#" label="Enum_MessageID" expand="no" />

      <cfset bodyStruct = IMAP4.GetBodyStructure(env.Get_MessageNumber(),  Enum_MessageID.OrdinalPosition) />


      n.b. IMAP4 and env are other class instatiations that are properly formed and have been used extensively up to this point.


      The GetBodyStructure function is documented here:
      http://www.quiksoft.com/emdotnet/docs/html/ndocQuiksoftEasyMailIMAP4IMAP4ClassGetBodyStruc tureTopic_2db5939b.html

      The MessageID Enum is documented here:
      http://www.quiksoft.com/emdotnet/docs/html/ndocQuiksoftEasyMailIMAP4MessageIDClassTopic_3d 4eda2d.html


      The error is always a thrown exception:

      The GetBodyStructure method was not found.

      Either there are no methods with the specified method name and argument  types, or the GetBodyStructure method is overloaded with argument types  that ColdFusion cannot decipher reliably. ColdFusion found 0 methods  that matched the provided arguments. If this is a Java object and you  verified that the method exists, you may need to use the javacast  function to reduce ambiguity.


      As javacast can only be used for elemental datatypes, there's no way I can find to coerce the "ordinalposition" into the proper data type.


      I've also tried creating a "class" of Quiksoft.EasyMail.IMAP4.MessageID.OrdinalPosition which creates fine, but is still useless in the function call.


      I've hunted everywhere and can find only two places this is talked about.  One is here: http://forums.adobe.com/message/123943#123943 (unanswered since 2007) and the other ishttp://forums.adobe.com/message/2417973#2417973 which doesn't work (i.e. "JavaCast(enum,1)" is not valid).


      I'm stuck and out of ideas.


      A little help?


      Upgrading to CF9 is not an option.