0 Replies Latest reply on Sep 30, 2008 11:28 PM by RustyAxeSys

    How can I pass a .Net StringCollection to a .Net object using CF 8?

    RustyAxeSys Level 1
      Hi

      I'm attempting to get CF 8 to interface with dtSearch, a free text search engine. It has a COM interface but CF consistently crashes when we get more than 100,000 returns. So dtSearch have suggested using the .Net interface as it has a callback mechanism which should prevent the issue. However, to get dtSearch to run a search I need to tell it the location of the index to search on. The interface for this is:

      public System.Collections.Specialized.StringCollection IndexesToSearch {get; set;}

      So I need to be able to pass a .Net System.Collections.Specialized.StringCollection object to this function. (for info on StringCollection see here)

      Unfotunately, CF does not appear to allow me to do this. If I do:

      local.index = createObject(".NET", "System.Collections.Specialized.StringCollection");
      local.index.Insert(0, "D:\DataImages\PigVWolfe\full_text");
      objSearchJob.Set_IndexesToSearch(local.index); // objSearchJob is a dtSearch.Engine.SearchJob object - see here

      CF says:

      The Set_IndexesToSearch method was not found.
      Either there are no methods with the specified method name and argument types, or the Set_IndexesToSearch method is overloaded with argument types that ColdFusion cannot decipher reliably. ColdFusion found 0 methods that matched the provided arguments.

      I suspect that CF is not passing local.index as a StringCollection object, hence the error. The strange thing is that when I do a dump of local.index is has all the methods and properties of StringCollection. I am also able to call the methods and properties successfully. But for some reason CF seems unable to pass this data type to dtSearch.

      Am I doing something wrong? If not, is this intended behaviour or a known issue which will be fixed in the next release?

      Any assistance or insight into this would be greatly appreciated.

      Thanks

      Nathan