473,386 Members | 1,804 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.

Confusion with using abstract classes and COM objects

Hi,
I am unable to access all properties and methods in a COM .DLL that I
have. The properties and methods exposed by the .dll all appear as
"abstract" when I view them in the Object Browser.

To illustrate they look something like this:

COMComponent (ie foo.dll)
public abstract new ComComponent.Property1_ Property[ get]
public abstract new void Method1( )

After a bit of research on this I have found that I need to create a
class that derives from the COM object and then access the new class.
Visual Studio automatically completed the declaration of this for me and
gave me something like you see bellow.

public MyClass:COMComponent.Class
{
public ComComponent.Property1_ Property
{
get
{
// TODO: Add MyClass.Property getter implementation
return new ComComponent.Property1_ ();
}
}

public ComComponent.Method1(string param1, out object param2)
{
// TODO: Add MyClass.Method1 implementation
param2 = null;
}
}

It then seems like a simple matter to access the COM object as follows:

static void main()
{
MyClass NewObj = new MyClass();
System.Console.WriteLine("Result: {0}", NewObj.Property);
}

How do I directly access the underlying class? To illustrate because the
COM objects declaration is abstract I am unable to create a new
reference to it directly (ie ComComponent.Something foo = new
ComComponent.Something()) or to access its members directly.

Thanks in advance

Nov 16 '05 #1
0 869

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

Similar topics

10
by: Stefan Seefeld | last post by:
hi there, I'm trying to convert a tuple to a list, and get a 'TypeError: list objects are unhashable'. Can anybody enlighten me as to the possible causes for this ? Where does hashing come...
38
by: Grant Edwards | last post by:
In an interview at http://acmqueue.com/modules.php?name=Content&pa=showpage&pid=273 Alan Kay said something I really liked, and I think it applies equally well to Python as well as the languages...
5
by: ma740988 | last post by:
Prefer composition to inheritance (can't recall which text I stole that line from) is one of the fundamental tenets thats engrained in my mind. Having said that inheritance requires careful...
9
by: craig | last post by:
Assume that you would like to create a custom collection class that is: 1. Strongly-typed (only holds Customer objects) 2. Read-only (user cannot add Customer objects) 3. Able to be bound to...
10
by: Brett | last post by:
I'm still trying to figure out concrete reasons to use one over the other. I understand the abstract class can have implementation in its methods and derived classes can only inherit one abstract...
8
by: Manuel | last post by:
Hi! If I've a vector filled with abstract classes, can I push in it the derived classes too? Even if derived classes have new methods? I've done some experiments, and it seem I can push the...
2
by: talkingpidgin | last post by:
I am trying to figure out why it is not conventional to use protected constructors in abstract classes since the only time they should be called is by the constructors of it's derived classes. Is...
1
by: sk.rasheedfarhan | last post by:
Hi , I am using C# I am having 4 classes. like below. public class A { String m_strRuleName; String m_strRuleGuid; // Some member functions. public Object NextItem; }
5
by: =?Utf-8?B?UmljaA==?= | last post by:
Greetings, I am actually a VB.Net guy, but I have worked somewhat with C++ and C#. I just want to ask about the relationship between Abstract Classes and Interfaces. My first question is if...
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: 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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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.