473,382 Members | 1,752 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.

C programming interface for .NET based Library

Hi All,
We have a .NET library having .NET remoting based programming interface
developed using VC++.NET (VS 2005 Beta2).

We want to provide C interface for a legacy application. Is it possible?
If yes, what would be the best approach?

Regards,
RS
Nov 17 '05 #1
3 1173
"Ratan" <Ra***@discussions.microsoft.com> wrote in message
news:54**********************************@microsof t.com...
We have a .NET library having .NET remoting based programming interface
developed using VC++.NET (VS 2005 Beta2).

We want to provide C interface for a legacy application. Is it possible?
If yes, what would be the best approach?


You can use the assembly registration (regasm) utility

http://msdn.microsoft.com/library/de...lregasmexe.asp

to "create" a COM object and type library from your .Net classes. Your C
application makes use of your .Net classes just as it would any other COM
object. I sketched the procedure with a toy .Net class and a C++ caller
here:

http://groups.google.com/group/micro...7cc21dc2b67f3d

If C++ rather than C is an option you can create an unmanaged C++ class (or
classes) which has one public method for every method of every class in your
..Net solution. Then the C++ application can use the "it just works" method
of interop

http://msdn.microsoft.com/library/de...nunmancode.asp

so that every call to one of these unmanaged methods is implemented by
calling on the corresponding managed method.

Regards.
Will
Nov 17 '05 #2
Hi Ratan!
We have a .NET library having .NET remoting based programming interface
developed using VC++.NET (VS 2005 Beta2).

We want to provide C interface for a legacy application. Is it possible?
If yes, what would be the best approach?


There are several ways to do this:
- COM-Interop (regasam as William said already)
- CLR-Hosting
- Managed C++ (if you write a DLL this might be possible; never tested
it...)

For more infos see:
http://www.gotdotnet.com/team/clr/wh...r_hosting.aspx
--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/
Nov 17 '05 #3
Hi,

Thank you very much to *both of you* for your suggestion.
I will proceed according to your suggestions.

Regards,
RS

"Jochen Kalmbach [MVP]" wrote:
Hi Ratan!
We have a .NET library having .NET remoting based programming interface
developed using VC++.NET (VS 2005 Beta2).

We want to provide C interface for a legacy application. Is it possible?
If yes, what would be the best approach?


There are several ways to do this:
- COM-Interop (regasam as William said already)
- CLR-Hosting
- Managed C++ (if you write a DLL this might be possible; never tested
it...)

For more infos see:
http://www.gotdotnet.com/team/clr/wh...r_hosting.aspx
--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/

Nov 17 '05 #4

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

Similar topics

0
by: Jesper | last post by:
I know that user interface library questions come up on this list every now and then. I've lurked here for a while and also searched google for anything that would fit my needs but haven't found...
3
by: Sai Kit Tong | last post by:
I posted for help on legacy code interface 2 days ago. Probably I didn't make it clear in my original mail. I got a couple of answers but none of them address my issues directly (See attached...
3
by: Ohad Young | last post by:
Hi, I have an interface with an event. I'd like to explicitly implement the interface by a certain class. However, I received the following error: "An explicit interface implementation of an...
5
by: Patrick Kristiansen | last post by:
Hi group! I've been reading Juval Löwys "Programming .NET Components", and I think it is a very good book, giving nice guidelines on how to really exhaust the possibilities of .NET in general. ...
21
by: Helge Jensen | last post by:
I've got some data that has Set structure, that is membership, insert and delete is fast (O(1), hashing). I can't find a System.Collections interface that matches the operations naturally offered...
6
by: Ricky W. Hunt | last post by:
It's dawning on my a lot of my problems with VB.NET is I'm still approaching it in the same way I've programmed since the late 70's. I've always been very structured, flow-charted everything, used...
16
by: Malcolm McLean | last post by:
I want this to be a serious, fruitful thread. Sabateurs will be plonked. Table-based programming is a new paradigm, similar to object-orientation, procedural decomposition, or functional...
151
by: istillshine | last post by:
There are many languages around: C++, JAVA, PASCAL, and so on. I tried to learn C++ and JAVA, but ended up criticizing them. Is it because C was my first programming language? I like C...
6
by: John Ladasky | last post by:
Hi folks, I've played around with neural nets for a while. I wrote my own slow, pure-Python NN package. I knew that there were Python NN packages out there -- but I couldn't really understand...
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: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
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: 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
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?

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.