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

D

Darwin

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;
}
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top