System. reflection. Missing-resurrection of the VB6 missing parameters.

Source: Internet
Author: User
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 );

If you wanna ignore passing the rest arguments in the navigate method before t for the first one, you have to use the missing value, instead of null or any other C # value.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.