473,327 Members | 2,118 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,327 software developers and data experts.

port a MFC application to .NET

Hello!

We have a big and rather complex MFC dll that we intent to port to .NET.
If we intent to port the code to a managed C++.dll will this be nearly as
much as rewriting
everything to C#.

//Tony

Oct 30 '08 #1
2 1418
I believe for things like this VC++ 6.0 permits to you to build your COM components.

Carlos

"Tony Johansson" <t.*********@logica.comwrote in message
news:e5**************@TK2MSFTNGP06.phx.gbl...
Hello!

We have a big and rather complex MFC dll that we intent to port to .NET.
If we intent to port the code to a managed C++.dll will this be nearly as
much as rewriting
everything to C#.

//Tony

Oct 30 '08 #2
On Thu, 30 Oct 2008 06:04:16 -0700, Tony Johansson
<t.*********@logica.comwrote:
We have a big and rather complex MFC dll that we intent to port to .NET.
If we intent to port the code to a managed C++.dll will this be nearly
as much as rewriting
everything to C#.
That depends on how you port it. But, if you leave most of the code alone
and just write a managed code wrapper for it, I think it would probably be
much less work than rewriting everything from scratch in C#. I think you
should be able to write a managed C++ wrapper in its own module, so that
you don't even have to touch the MFC DLL itself.

For that matter, you might find that writing the wrapper in C# using
p/invoke works well too. Personally, I've found it difficult to find
really clear, comprehensive documentation on how to use p/invoke but it's
been awhile since I've tried. Maybe the doc situation is better now.

Making the wrapper in C++ will require a little extra coding, but you'll
have more direct control over how data is marshaled. Conversely, using
p/invoke might make certain conversions harder to do, but most of the
implementation should simply be declarations and wrappers, which could
make the coding go faster (depending on how long it takes to get up to
speed with p/invoke).

All that said, if your intent is to actually _rewrite_ the DLL in managed
C++, I don't see how that'd be significantly simpler than doing the same
rewrite in C#. Managed C++ is a lot more like C# than it is like MFC.
Most of the effort will be in translating the MFC stuff to .NET, and that
work will be the same in managed C++ as in C#. If you're looking to
actually rewrite the DLL, I'd say pick your language based on your
intended future use...the actual porting isn't likely to be affected much
either way.

Pete
Oct 30 '08 #3

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

Similar topics

4
by: ^CeFoS^ | last post by:
Hello to everybody, I've done an application that draws in a frame the trajectory of a robot. The robot position is readed through the serial port, and several commands are wrote through the...
2
by: Greg W. | last post by:
In our setup project, we have the standard web application folder, but we also have 4 web custom folders (virtual directories) that are created at the same level as the web application folder...
13
by: Al the programmer | last post by:
I need to access the serial ports on my webserver from an asp.net page. I have no problem accessing the serial ports from a windows form application, but the code doesn't work in asp.net. I have...
2
by: Mark Lauser | last post by:
Hello, I'm running a vb.net Windows application that communicates with a SQL Server using SQLClient.SQLConnection. How do I specify the port on the client that should be used for this...
4
by: joe bloggs | last post by:
I am writing a mobile application to interface with a legacy system and I am planning to use web services to communicate with this system. The legacy system receives data through a serial port. ...
1
by: henrycortezwu | last post by:
Hi All, I'm trying to connect to a virtual port (COM19, OUTGOING, "Bluetooth Serial Port") using VS2005 System.IO.Ports. When I ran the ff code below here's what happens. 1) VS2005 Compiles w/o...
2
by: pranshu | last post by:
Hello All, I have a web application which I need to deploy on a particular web server on a machine having different web servers on different IP addresses. I havent been able to find a way to do...
10
by: TS | last post by:
i just noticed the website i created in VS 2005 is running on a different port than the default. I see that it is running on the local web server, and also that the website i created isn't in IIS....
5
by: Maciej Sondej | last post by:
Hi, I have problem. I want to react on event which come from IO.Port(RS232). I have a class that works on console application class Program { static void Main(string args) {
0
by: aymen | last post by:
Hi all, I have 2 applications trying to gain access to the same GPRS modem port COM3 (the 1st application comes with the product and can't be configured to use another port and 2nd application is...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.