Re: ... does not contain any types that can be registered for COM Interop.



ok, found it. AssemblyInfo.cs has
[assembly: ComVisible(false)] by default.

"Darwin" <darwin@xxxxxxxxxxx> wrote in message
news:u6xOnZwMIHA.2064@xxxxxxxxxxxxxxxxxxxxxxx
I am trying to register a .Net class for COM interop in VS2005. When I went
to add a class there was no "COM class" as a template, so I am trying to
code it myself. But I keep getting "... does not contain any types that can
be registered for COM Interop." as a warning during compile and the COM
object does not get registered.

Any ideas? (code below)

thanks

using System;
using System.Data;
using System.Drawing;
using System.Drawing.Imaging;
using System.Collections.Generic;
using System.Text;
using Captcha;
using System.Runtime.InteropServices;

namespace ImageProcessing{

[Guid("D6F88E95-8A27-4ae6-B6DE-0542A0FC7039")]
[InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
public interface _Captchas
{
[DispId(1)]
Boolean createImage(string s, int width, int height, string familyName,
string filename);
}
[Guid("13FE32AD-4BF8-495f-AB4D-6C61BD463EA4")]
[ClassInterface(ClassInterfaceType.AutoDual)]
[ProgId("ImageProcessing.Captchas")]
public class Captchas : _Captchas
{
public Boolean createImage(string s, int width, int height, string
familyName, string filename)
{
CaptchaImage ci = new CaptchaImage(s, width, height, familyName);
ci.Image.Save(filename, ImageFormat.Jpeg);
return true;
}
}
}





.



Relevant Pages

  • ... does not contain any types that can be registered for COM Interop.
    ... I am trying to register a .Net class for COM interop in VS2005. ... Boolean createImage(string s, int width, int height, string familyName, ... public class Captchas: _Captchas ...
    (microsoft.public.dotnet.general)
  • [REVS] Defeating Voice Captchas
    ... Defeating Voice Captchas ... Jochem van der Vorm has written a elegant paper and proof of concept to ... Later Jochem found a post about voice captchas. ... int samplerate; ...
    (Securiteam)
  • Re: flatulent-0.0.3
    ... > in most image bases captchas) this works all of the time. ... require 'flatulent' ... def deflatulent string ...
    (comp.lang.ruby)
  • Re: flatulent-0.0.3
    ... in most image bases captchas) this works all of the time. ... require 'deflatulent' ... def deflatulent string ...
    (comp.lang.ruby)