Groups | Blog | Home
all groups > dotnet interop > march 2005 >

dotnet interop : ASP and overloaded methods


Johan Karlsson
3/23/2005 9:02:25 AM
Hi!

I'm sure this question have been asked before, but I cannot seem to find it
in here.
I've have a classlibrary written in .net that's exposed to com via interop
(registered in the GAC and so on).

Is there anyway to call overloaded functions from a script environment?

Example:

Public Sub MyFunction( byval subject as string, byval body as string )
Public Sub MyFunction( byref m as message )

Thanks!
/Johan

Mario Kropik
3/23/2005 10:22:38 AM

[quoted text, click to view]

To have a close look at your COM visible declarations set a reference in
Visual Basic 6 and use object browser. So you can see how your overloaded
function is exposed to COM.

Typically .NET exposes your functions with the appendix _1, _2, _3,... if
you have overloaded functions visible to com. If don't like this behavior
your should consider to declare your overloaded functions as private and
expose a function with optional parameters. This public and COM visible
function can decide - depending on optional parameters recieved - which
overloaded private function to call.

Mario

Johan Karlsson
3/23/2005 11:29:28 AM
Thanks for a quick reply!
Keep up the good work!

/Johan

[quoted text, click to view]

AddThis Social Bookmark Button