optional parameters - C#

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • lakshmi

    #1

    optional parameters - C#

    include the following lines of code:

    using System.Runtime. InteropServices ;
    prefix the optional argument with [OptionalAttribu te]

    This takes care if an optional parameter is not supplied
    by a VB script client.[color=blue]
    >-----Original Message-----
    >I found that optional parameters are not supported in C#.
    >We are currently rewriting a C++ dll in C#. The C++ dll
    >has methods that use optional parameters frequently.
    >The client is VB script that calls the methods in the
    >following manner.
    >
    >method definition in C++
    >method(VARIA NT v1, DATE time, [in, optional] BOOL b1,
    > [in,optional] short s1]
    >
    >The VB Script client calls the method like this.
    >
    >method(v1, time, ,50)
    >
    >How do I support the above syntax from my .NET C# dll now?
    >I would appreaciate any help.
    >.
    >[/color]
Working...