473,382 Members | 1,717 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

... 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. 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.InterfaceIsIDispatc h)]
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;
}
}
}

Nov 30 '07 #1
1 6946
ok, found it. AssemblyInfo.cs has
[assembly: ComVisible(false)] by default.

"Darwin" <da****@nowhere.comwrote in message
news:u6**************@TK2MSFTNGP06.phx.gbl...
>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.InterfaceIsIDispatc h)]
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;
}
}
}

Nov 30 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Andrea | last post by:
Hi everyone, I am in the process of learning javascript and have a question on location.href. Does javascript always require the <script language = "javascript"> (or script...
2
by: anand | last post by:
Hi, We have developed a web application, which uses Interop.Word.dll to read from word documents and write to word documents. Problem is that our client is persisting that we develop the...
1
by: compassSoftware | last post by:
I am trying to work on an application that uses a dll as a COM object. I am coming in late to this project to administer/update the application. I notice in the References that a particular...
6
by: JROCamaro | last post by:
I have compiled code that populates data from sql database into an excel document on the client. When moving code to the web server and running it, I get an error COM object with CLSID...
1
by: Jim | last post by:
Have fully operational software package developed on VB.NET that worked until Jan 1 2003, with early stage deployments on Oct 10, Oct 23, Nov 11, Dec 12 and Dec 30. When attempted final...
3
by: Hughsie | last post by:
Hi I have created an installation package for my app and I have installed the application onto another machine together with the framework and the correct MDAC version. The problem is when I...
4
by: haitao.song | last post by:
Hi, As it is always stated that value type is allocated on stack, while reference types are on managed heap. How about the struct with string members? stuct A { string str; } String type is...
12
by: Nelluru | last post by:
Hi, I am using Office XP PIA's to read a word document. I am able to read the whole content. The problem is that i want to get a particular word in the document instead of the whole content. ...
2
by: Rossouw | last post by:
Good day, I know there are numerous questions about the HRESULT 0x80040154 (REGDB_E_CLASSNOTREG) error, and I have seen all (maybe most) of the solutions, but none of those are of any help, I...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.