Creating C# components to be usable with multiple languages

Z

zorrothefox.groups

Hi,
I am currently working on a project that requires some key
functionality to be implemented as a c# class library. This is
currently only called from a C# GUI Application. Now the scenario is
that we need this class library to be callable from a c# GUI, a c++
com client, or a Perl script.

My first question is, is this possible? If so, how do I go about
changing the c# class library to achieve this.

My second question is:
I need to support callback functions in this
class library. For example, the c++ client might call a function
Analyze() in the c# class library. Now, this Analyze() is a very
length operation. So, it'd be good if the C# library could call back a
function in my c++ client once in a while (say to update a progress
indicator). How would I go about supporting this? It'd also be great
if I could implement this in a way where even a perl script (say)
could be called back.

I don't know if I'm asking for too much here. Any tips, or references
are appreciated. Though even detailed step-by-step information would
be welcome ;-)

Thanks in advance,
Bharat.
 
E

Ebbe Kristensen

I am currently working on a project that requires some key
functionality to be implemented as a c# class library. This is
currently only called from a C# GUI Application. Now the scenario is
that we need this class library to be callable from a c# GUI, a c++
com client, or a Perl script.

My first question is, is this possible? If so, how do I go about
changing the c# class library to achieve this.

I don't know anything about COM objects, so somebodye else will have to step
in here. But for the Perl part I would take a look at the Perl Dev Kit from
ActiveState:

http://www.activestate.com/Products/perl_dev_kit/feature_list.plex

Wheher it solves all your problems, I cannot say.

Ebbe
 
S

schneider

Yes it's possible, make COM visible, and you should also make is CLS
compliant. I think you will need to sign the assembly also.

Schneider
 
Z

zorrothefox.groups

Hi,
Thanks a lot for all your replies. I found the link you gave to
be quite good. I've successfully managed to get perl to interact with
my .net c# class library. I'll post the details once I have cut the
code to the minimum requirements.

Thanks,
Bharat.
 
Z

zorrothefox.groups

Hi,
Thanks a lot for all your replies. I found the link you gave to
be quite good. I've successfully managed to get perl to interact with
my .net c# class library. I'll post the details once I have cut the
code to the minimum requirements.

Thanks,
Bharat.
 

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