Вопрос

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?

Это было полезно?

Решение

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

Другие советы

It represents the null value.

From MSDN

Represents the sole instance of the Missing class.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top