NETLink Q: How Create Array of specified Type?
- To: mathgroup at smc.vnet.net
- Subject: [mg47657] NETLink Q: How Create Array of specified Type?
- From: "ToolmakerSteve" <ToolmakerSteve at shawstudio.com>
- Date: Tue, 20 Apr 2004 03:19:29 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Todd, NetLink version 1.0 automatically creates arrays of primitive types: MakeNETObject[ {11, 22, 33} ] => NETObject[System.Int32[]] but I haven't found a way to specify the type of an array, so I can fill that array with values. Need to do this, so that I can invoke some advanced methods in CodeDOM, with parameters of arrays of particular CodeDOM types. Ironically, I couldn't use Reflection on class Array to work around this, because to locate the CreateInstance method I needed an array of Types. A "circular" difficulty! I can do this: MakeNETObject[ {GetTypeObject[ LoadNETType[ "System.Type" ] ], GetTypeObject[ LoadNETType[ "System.Int32" ] ]} ] => NETObject[System.Object[]] Now how do I turn this into a NETObject[System.Type[]] -- ToolmakerSteve