CreateManagedObject()

Summary

Creates a new instance of a .NET Object.

Changes

Added to Version 6.0/2012.

Syntax

managedobject = CreateManagedObject(string assemblyName, string typeName, array parameters [, array options])

Argument Contents
assemblyName The name of the assembly that contains the type for which you are creating an object (for assemblies stored in the system's Global Assembly Cache), or the path to the DLL assemblies
typeName The fully qualified type name, including its namespace
parameters An array of input parameters to be passed to the constructor for the object
Option Type Contents
Event Macro string Name of a macro callback that will be called for .NET events fired by the object
Events array An array of strings for the names of the events for which the macro will be called
Generic array An array of either strings or objects of type System.Type representing the type parameters for a generic object

Returns

A .NET Object.

Notes

  • A null value can be provided for the assemblyName parameter if the type is found in mscorlib.dll.

  • The event macro is called with 3 arguments: the .NET object, the event name as a string, and an array containing the parameters passed by the event.

  • For more information on .NET objects, see Accessing .NET Objects.

Error Codes

Error Type Meaning
NotFound Unable to create the object

See Also

Function Summary
CloseDotNetControl() Closes the window containing the .NET control
ConvertManagedObjectType() Access a .NET object using a different interface type
CreateDotNetControl() Creates a new .NET control window
GetDotNetControlObject() Gets the .NET object in a .NET control window
GetManagedClass() Gets an object representing the .NET class for calling static methods
SetDotNetControlTitle() Sets the title of a .NET control window