473,386 Members | 1,823 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,386 software developers and data experts.

Constructor in a class that exposes a COM interface

I am implementing a C# class that exposes a COM interface so that a huge
body of code that pre-dates .NET can use it. I noticed if I put a simple
constructor in the class the class does not get registered properly as a COM
object.

class DoStuff
{
bool myState;

public DoStuff()
{
myState = true;
}
..
..
..
}

Without the constructor it registers just fine.

So, how do I get member variables initialized in this class that is exposed
as a COM object?

Craig
Nov 16 '05 #1
0 856

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

Similar topics

4
by: Andy Venikov | last post by:
Hi all, is there a way to make certain functions of a class be accessible only by specific class? Like "friend class whatever", but only for a few functions? This could be usefull in a...
21
by: Steve - DND | last post by:
I know it's possible to require inheriting classes to implement a particular function or property, but is it possible to require a inheriting class to implement a constructor of it's own? ...
10
by: linkspeed | last post by:
Following texts are from C# spec. The optional constructor-initializer specifies another instance constructor to invoke before executing the statements given in the constructor-body of this...
20
by: Ole Hanson | last post by:
I am accessing my database through an interface, to allow future substitution of the physical datastore - hence I would like to declare in my Interface that my DAL-objects implementing the...
6
by: Edward Diener | last post by:
Since a C++ using declaration isn't allowed in MC++, is there a way to specify that a property, method, event, or field's access can be changed in a derived class, ie. is protected in one class and...
8
by: Gregory | last post by:
I have a question about using STL containers in C++ class public interface. Lets say that I want to return some container from class method or accept class method parameter as some container. For...
2
by: BBM | last post by:
I have the following base class that uses Generics in its definition. MyList(of T, C) - T is a BindingList(Of C), C is the type in the list I have many implemented classes...
2
by: gilbert | last post by:
Hello. I am trying to use c# generic to define a class. class MyClass<Twhere T: new(){ } In this definition, MyClass can create T objects with a default constructor. Is there any way to...
1
by: Peter Duniho | last post by:
On Fri, 11 Apr 2008 01:43:52 -0700, Weeble <clockworksaint@gmail.com> wrote: That's not a difference. The code example you compared to has the implication that A will use the IB instance...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.