I've played around a bit, and the *only* way I've made this happen is
to not use method overloading, but change them all into a single
method like this:

    public void Method(string S, [Optional]string T)

Is this really the only way to do it? It means I have to collapse all
public overloaded methods into single methods using the
OptionalAttribute on every parameter.

On Mon, Aug 25, 2008 at 9:05 AM, Vicke Lööd <[EMAIL PROTECTED]> wrote:
> In my C# class library, I have these ComVisible method overloads:
>
>  public void Method(string S)
>  public void Method(string S, string T)
>
> If I set the ClassInterfaceType to AutoDual, these appear in VB6
> intellisense like this:
>
>  Method_1(string S)
>  Method_2(string S, string T)
>
> However, I would like them to appear like this in VB6, with optional 
> parameters:
>
>  Method(string S[, string T])
>
> How can I make this happen? Do I have to set the ClassInterfaceType to
> None and put some attributes on the overloads? Which? Would the
> OptionalAttribute help at all?
>
> I know this is possible to achieve because COM DLLs generated by
> "Microsoft SDK for Java 4.0" (on the Java version of the same source
> code) turns overloaded Java methods into COM/VB6 methods with optional
> parameters.
>
> Also, less importantly, I have a public ComVisible field in my C# class 
> library:
>
>  public const string S = "S";
>
> Again, if I set the ClassInterfaceType to AutoDual, this field does
> not appear in the VB6 intellisense. What do I have to do to make this
> happen? Do I have to convert the field to a property? Or can I put
> some attributes on the field? Again, "Microsoft SDK for Java 4.0"
> turned this into what looks like a public field in VB6. (Looking at
> the exported TLB for the Java DLL, it looks like a property, but I'm
> no COM expert.)
>
> I've look at all MSDN documentation, but I can't find the answers to
> these questions.
>

===================================
This list is hosted by DevelopMentor®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to