December 2002
Intermediate to advanced
720 pages
17h 39m
English
A managed class can have overloaded methods. A single method name can have multiple argument lists and return values. Unfortunately, COM does not support overloaded methods. The CCW that .NET exposes to unmanaged clients handles this mismatch by exposing one unmanaged method that has the exact name as the overloaded method. It then exposes the other overloaded versions of the method with _N appended to the managed name where N starts at 2. For instance, given the following managed class, which has three different versions of a method called TestMethod:
using System;
using System.Runtime.InteropServices;
namespace TestOverload
{
public class TestClass
{
public TestClass()
{
}
public string TestMethod(int arg1)
{
return "TestMethod(int ...Read now
Unlock full access