COM ->. NET - no puede acceder al método sobrecargado
Estoy intentando acceder a una biblioteca .Net (The Image Resizer) de COM (jscript).
He intentado tanto IDispatch como la generación de interfaz de clase, así como [ClassInterface (ClassInterfaceType.AutoDual)] en la clase en cuestión.
Hay un método con 3 sobrecargas:
Bitmap Build(object, ResizeSettings settings)
void Build(object source, object dest, string settings)
void Build(object source, object dest, ResizeSettings settings)
Vocació
Build("file",s); //works
Los siguientes generan "Número incorrecto de argumentos o asignación de propiedad no válida" (error de tiempo de ejecución JScript)
Build("file","file", s)
Build("file","file","settings
No encuentro ninguna razón por la que las sobrecargas no funcionen a través de la interoperabilidad, especialmente cuando el recuento de argumentos es diferente. ¿Me estoy perdiendo de algo
Update: Aquí está el código completo de las definiciones de métodos. La segunda sobrecarga es inaccesible. No se trata solo de estos métodos: en todos los métodos sobrecargados, solo parece que puedo acceder a la primera sobrecarga. ¿Es este un error COM / error de diseño no documentado?
/// <summary>
/// Provides methods for generating resized images, and for reading and writing them to disk.
/// Use ImageBuilder.Current to get the current instance (as configured in the application configuration), or use ImageBuilder.Current.Create() to control which extensions are used.
/// </summary>
public class ImageBuilder : AbstractImageProcessor, IQuerystringPlugin
{
/// <summary>
/// Resizes and processes the specified source image and returns a bitmap of the result.
/// This method assumes that transparency will be supported in the final output format, and therefore does not apply a matte color. Use &bgcolor to specify a background color
/// if you use this method with a non-transparent format such as Jpeg.
/// </summary>
/// <param name="source">May be an instance of string (a physical path), VirtualFile, IVirtualBitmapFile, HttpPostedFile, Bitmap, Image, or Stream.</param>
/// <param name="settings">Resizing and processing command to apply to the.</param>
public virtual Bitmap Build(object source, ResizeSettings settings) {
BitmapHolder bh = new BitmapHolder();
Build(source, bh, settings);
return bh.bitmap;
}
/// <summary>
/// Resizes and processes the specified source image and stores the encoded result in the specified destination.
/// </summary>
/// <param name="source">May be an instance of string (a physical path or app-relative virtual path), VirtualFile, IVirtualBitmapFile, HttpPostedFile, Bitmap, Image, or Stream. app-relative virtual paths will use the VirtualPathProvider system</param>
/// <param name="dest">May be a physical path (string), or a Stream instance. Does not have to be seekable.</param>
/// <param name="settings">Resizing and processing command to apply to the.</param>
public virtual void Build(object source, object dest, ResizeSettings settings) {
ResizeSettings s = new ResizeSettings(settings);