Click here to Skip to main content
15,845,367 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have developed a sample app on converting the doc to pdf file.
But I just want to know the meaning of this statement.

C#
object Unknown=Type.Missing;
 MSDOC.Documents.Open(ref Source, ref Unknown,
                ref Unknown, ref Unknown, ref Unknown,
                ref Unknown, ref Unknown, ref Unknown,
                ref Unknown, ref Unknown, ref Unknown,
                ref Unknown, ref Unknown, ref Unknown,
                ref Unknown, ref Unknown);

Why do we write the "ref Unknown"? Please explain me.

Thanks in advance
Posted
Updated 11-Oct-10 22:08pm
v2

1 solution

It means that you don't care about the value of parameter passed to the invoked COM method. In some languages can be those values missed.

In C# you must pass all of them.
 
Share this answer
 
Comments
Toli Cuturicu 12-Oct-10 3:20am    
In C# 4.0 you can miss them also.
voloda2 12-Oct-10 3:22am    
Ok, thanks for clarification. But it's possible only with dynamic methods. Isn't it?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900