Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does System.Reflection.Missing.Value do?

I encountered a code given below

Object oMissing = System.Reflection.Missing.Value
oDataDoc = wrdApp.Documents.Open(ref oName, ref oMissing,
                    ref oMissing, ref oMissing, ref oMissing, ref oMissing,
                    ref oMissing, ref oMissing, ref oMissing, ref oMissing,
                    ref oMissing, ref oMissing, ref oMissing, ref oMissing,
                    ref oMissing);

I dont understand what will ref oMissing do. Will it automatically get the values or something like that?

like image 347
Murtaza Munshi Avatar asked Sep 01 '13 06:09

Murtaza Munshi


People also ask

What is the use of system reflection namespace?

Reflection Namespace. Contains types that retrieve information about assemblies, modules, members, parameters, and other entities in managed code by examining their metadata. These types also can be used to manipulate instances of loaded types, for example to hook up events or to invoke methods.

What is Microsoft reflection?

Reflection provides objects (of type Type) that describe assemblies, modules and types. You can use reflection to dynamically create an instance of a type, bind the type to an existing object, or get the type from an existing object and invoke its methods or access its fields and properties.


2 Answers

It represents null value. Note that null is not equal to Missing.Value

Just to add more information, as you can see in the screen shot below, Missing.Value is NOT equal to null, and in fact is a new instance of Missing class object

enter image description here

like image 107
Prash Avatar answered Nov 23 '22 12:11

Prash


It represents the null value.

From MSDN

Represents the sole instance of the Missing class.

like image 31
Rahul Tripathi Avatar answered Nov 23 '22 13:11

Rahul Tripathi