[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


Compiling and using C# class library

Posted on 2006-06-08
Medium Priority
Last Modified: 2010-04-16

I have a C# class library (.dll) developed in Visual Studio 2005, and I would like to compile it in a way that it can be called by programs from various environments (i.e. Oracle 9, C/C++ programs not developed in VS.NET, etc.) Is this possible without having to re-write the entire class library?

Question by:james567
LVL 25

Assisted Solution

dstanley9 earned 400 total points
ID: 16864851
Sure.  The most universal way would be to create a web service to encapsulate the library.  

I don't know about Oracle 9, but a more specific way would be to wrap the library in either a CCW (COM Callable Wrapper) or a managed C++ wrapper that accesses the library and could be called from C/C++.  

Depending on the complexity of your library (specifically the types that you want to expose), it could be fairly difficult.  If you're only dealing with low-level types (ints, strings, etc.) it may not be too difficult.

LVL 14

Accepted Solution

existenz2 earned 800 total points
ID: 16868516
Have a look at: http://www.codeproject.com/managedcpp/ijw_unmanaged.asp

It's an example from calling Managed Code from unmanaged C++.

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question