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

Permitting C access to managed .Net assemblies

I am in the process of upgrading an existing product code base from C++
to C#, converting the use of a named pipe for the client/server
communication to using .Net remoting via C# classes. Things are going
fairly well, and most of the plans are falling into place.

One wrinkle that was introduced recently was the discovery that some of
our 'partners' are insisting on continuing their development labs using
C++ or even C code, and they have no plans to convert to managed code.
In some cases they are even refusing to move to using anything later
than Visual Studio 6!

How difficult is it to write a DLL that will permit C/C++ code to access
the contents of a .Net assembly? With some small changes I can create
a client-side DLL that will contain all of the pieces needed, and I can
even add some wrapper methods to make the C/C++ invocation easier if I
need to, but I can find no information on how to achieve this.

All of the existing documentation is focused on how to permit managed
..Net code access the contents of unmanaged DLLs, which I do not need.

And the clients do not want to use COM objects either -- they are
writing C or C++ code, and the most some of them are using is MFC.

Is this even possible?

-ken
Nov 22 '05 #1
1 1084
Hi Ken,

As far as I know, I don't think you can create a DLL in .NET and access it
in your C++ application. DLLs written in .NET will need the .NET runtime to
execute, which will make it very difficult to bind to application's memory
space (win32 application).

Your best an easiest soultion would be COM interop. So you can create your
DLLs in .NET and register them as COM objects with the operating system,
then your VB6 or VC++ 6 can instantiate COM object without any problem.

Fitim Skenderi
"Ken Allen" <ke******@sympatico.ca> wrote in message
news:e9**************@TK2MSFTNGP10.phx.gbl...
I am in the process of upgrading an existing product code base from C++ to
C#, converting the use of a named pipe for the client/server communication
to using .Net remoting via C# classes. Things are going fairly well, and
most of the plans are falling into place.

One wrinkle that was introduced recently was the discovery that some of
our 'partners' are insisting on continuing their development labs using
C++ or even C code, and they have no plans to convert to managed code. In
some cases they are even refusing to move to using anything later than
Visual Studio 6!

How difficult is it to write a DLL that will permit C/C++ code to access
the contents of a .Net assembly? With some small changes I can create a
client-side DLL that will contain all of the pieces needed, and I can even
add some wrapper methods to make the C/C++ invocation easier if I need to,
but I can find no information on how to achieve this.

All of the existing documentation is focused on how to permit managed .Net
code access the contents of unmanaged DLLs, which I do not need.

And the clients do not want to use COM objects either -- they are writing
C or C++ code, and the most some of them are using is MFC.

Is this even possible?

-ken

Nov 23 '05 #2

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

Similar topics

1
by: Ken | last post by:
Hi, I'm trying to access the values of properties -- summary and custom without opening Word to do a cleanup op but the customer i'm doing it for only has Office 2000. I'm using c# in .net 2003...
22
by: Alper AKCAYOZ | last post by:
Hello Esteemed Developers and Experts, I have been using Microsoft Visual C++ .NET for 1 year. During this time, I have searhed some topics over internets. Most of the topics about .NET is...
5
by: | last post by:
I'm having difficulty embedding a managed C++ control in Internet Explorer. I'm using the same object syntax in the html as I would for a c# control, but IE doesn't seem to find the control in the...
0
by: Nadav | last post by:
Hi All, - I am working on a tool that manipulate managed assemblies, some of the functionality provided by the tool require manipulating the metadata sections of the managed assembly in a way it...
2
by: Pinnguy | last post by:
Hello, I have started to use managed C++ in VS 2003. I have several .NET class libraries written in MC++. I am finding the rebuild tendencies in VS to be very annoying. If I make a minor change...
5
by: Lyle Fairfield | last post by:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/callnetfrcom.asp The Joy of Interoperability Sometimes a revolution in programming forces you to abandon all...
5
by: achutha.sridhar | last post by:
I've a pretty basic question on managed code. I read through couple of.net documentation, and reached a state where I know that managed code would be run by the .Net run time and it has so and so...
0
by: sandrapatfer | last post by:
Hi, I have an activex developed with MFC that I want to use in IE. This was developed using several dlls also unmanaged but now I want to use managed assemblies. I want to distribute the...
2
by: Bob Altman | last post by:
Hi all, We have a native class modeled after the System::Exception class, and all exceptions that we throw derive from this class. For now this class is quite simple: just Description and...
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: 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
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.