I am an amator astronomer and I write driver for telescope with Delphi and the standard ASCOM
First a special thank to David Heffernan who has helped me a lot these 2 last months. I have made a lot of progress in the writing of drivers, and there is a judge: 'Conform', a program which test all the compatibilties of a driver. At the beginning it was very bad, and now I am on the good way. The last really unsolved problem is an ArrayList
of string
.
The documentation of Ascom Telescope driver has a property:
C#
ArrayList SupportedActions { get; }
Visual Basic:
ReadOnly Property SupportedActions As ArrayList
Get
Visual C++
property ArrayList^ SupportedActions {
ArrayList^ get ();
}
Field Value
An ArrayList of strings (SafeArray collection) containing the names of supported actions.An array list collection has been selected as the vehicle for action names in order to make it easier for clients to determine whether a particular action is supported. This is easily done through the Contains method. Since the collection is also ennumerable it is easy to use constructs such as For Each ... to operate on members without having to be concerned about hom many members are in the collection.
Collections have been used in the Telescope specification for a number of years and are known to be compatible with COM. Within .NET the ArrayList is the correct implementation to use as the .NET Generic methods are not compatible with COM.
So I have tried to make an automation object:
And the big judge "Conform" program send me that (sorry it's a translation of an error message in french):
ERROR .NET - Exception: System.InvalidCastException: Impossible to make a cast of a COM object of type 'System.__ComObject' in type of class 'System.Collections.ArrayList'. The instances of type representing COM component, can't be casted in types different from representing COM components; however they can be casted in interfaces until the COM component underlying takes in charge the calls
QueryInterface
for the IID of the interface!!!!!!!!!!!!!!!!??????????????
Chinese or old Greek are more obvious for me. The only thing I have found is that in regedit:
Thanks again for your help. For your eyes only, a picture made with my telescope and some home-writed program: