System.Reflection.Missing is a special class dedicated to represent the Missing parameter in VB6.

This class defined a static field Missing.Value to represent the sole instance of this class. Each time you have to use Missing object, you can only refer to this static value, and can not create any new instances.  If you are aware of the Singleton pattern, you will understand that.

The Missing object is useful and necessary when you want to communicate with the legacy COM components. Here is a trivial example:
The following sinppet will call the Microsoft WebBrowser control to navigate to www.sina.com:

            object missing = System.Reflection.Missing.Value;
            
this.axWebBrowser1.Navigate("http://www.sina.com"ref missing, ref missing, ref missing, ref missing);

If you wanna ignore passing the rest arguments in the Navigate method except for the first one, you have to use the Missing value, instead of null or any other C# value.
posted on 2004-12-09 15:06  Laser.NET  阅读(1170)  评论(0编辑  收藏  举报
无觅相关文章插件,快速提升流量