Just another reason to hate RealPlayer
Monday, July 11, 2005
This popped up the first time that I plugged in my iPod after installing RealPlayer.Are they insane? What makes them think I would possibly want to manage it with that POS?
This popped up the first time that I plugged in my iPod after installing RealPlayer.I looked at VB.NET for about 5 minutes but I can’t see a single compelling reason to use it. A few syntax constructs remain but basically it’s a new language and one that does not appear to be as well supported as C#. Whichever language you use, you still have to learn the Winforms way and the .NET API. The extra learning involved in C# syntax is negligible
There are scenarios for which late binding is justified. You may not know the exact binary interface until runtime. The object may exist in multiple versions and have improperly adapted interfaces between the versions.
// overloaded method, can pass the server name as second
// parameter if necessary.
Type myType = Type.GetTypeFromProgID("TestObject.TestClass");
// heavily overloaded method call. Can also be used with
// assembly file names if you have them.
object myObject = Activator.CreateInstance(myType);
// method parameters are passed in an object array.
// Must set these up before invocation
object [] oParms = new Object[]{"Echo This"};
// Invoke the method and cast the result to the correct
// object type.
string myString = (string) myType.InvokeMember("Echo1",BindingFlags.InvokeMethod,null,myObject,oParms);
MessageBox.Show(myString);
Dim MyObject As Object
Dim MyString as string
Set MyObject = CreateObject("TestObject.TestClass")
MyString = MyObject.Echo1("echo this back to me")
MsgBox MyString
Option Strict to Off - you can write code in all it's late bound glory.