More on late binding Read more

More on late binding

How about an example on how to use scripting capabilities in your application, if the script control is available, without setting any references? ‘Attempt to get the type for the script control. Dim ScType As System.Type = System.Type.GetTypeFromProgID( _ “MSScriptControl.ScriptControl”) ‘If the prog ID is missing, Null is returned (Nothing in Visual Basic). If ScType […]

Late binding when Option Strict is On Read more

Late binding when Option Strict is On

Once you have an object, you can dynamically decide what method to call, or property to use, by calling the InvokeMember function of the object’s type. In this example, I call the ShowDialog method of the object. Note that object members (non static) must have target instance, in my case X. Dim X As New […]