Groove Programming Tips & Tricks : Techniques to develop better tools in Groove
Updated: 1/21/2005; 10:19:38 AM.

 








Subscribe to "Groove Programming Tips & Tricks" in Radio UserLand.

Click to see the XML version of this web page.

 
 

Monday, August 19, 2002

Explicitly ask for an interface after getting it from PropertyList

When the PropertyList is used from script code to get an interface, one must keep in mind that the default IDispatch interface is returned from such a request, and in some cases this means you will not get the interface you asked for.  For example:

   //   The following line will get an IGrooveAccount interface
   var pIAccount = PropertyList.OpenProperty(PROPERTY_ACCOUNT);

   //   The following line will also get an IGrooveAccount interface, 
   //   but this is not what you would expect 
   var pITelespaceProvider = PropertyList.OpenProperty(PROPERTY_TELESPACE_PROVIDER); 

   //   This is the recommend way for both to make sure the expected
   //   interface is returned
   var pIAccount = PropertyList.OpenProperty(PROPERTY_ACCOUNT).Account;
   var pITelespaceProvider =
      PropertyList.OpenProperty(PROPERTY_TELESPACE_PROVIDER).TelespaceProvider;


8:05:18 AM    comment []

Use the "GrooveTelespace" object as reference to a tool's telespace

Starting with Groove v2.1, whenever you are using the free threaded version of the ScriptHost to write script code for your tool, you can now write code like:

   var pITransaction = GrooveTelespace.OpenTransaction(true);

        - instead of -

   var pITelespace = PropertyList.OpenProperty(PROPERTY_TELESPACE).Telespace;
   var pITransaction = pITelespace.OpenTransaction(true);


7:50:42 AM    comment []

© Copyright 2005 Paresh Suthar.



Click here to visit the Radio UserLand website.
 


August 2002
Sun Mon Tue Wed Thu Fri Sat
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
Jul   Sep