tags:

views:

134

answers:

2

Is there any way to convert C++ program into ASP.NET?Thanx for reply in advance.

+10  A: 

No there is not.

You have some options though:

  • You can create a managed C++ / CLI DLL from your C++ code.
  • You can create a C++ Win32 DLL and use p/invoke to import the DLL functions into your ASP.NET page.
  • Re-write your code in C# or another .Net language.
Brian R. Bondy
If your program is complex and you don't have time or the real need to rewrite, then this is a good option.
JohnFly
+7  A: 

Yes, assuming you are using windows - goto command prompt and locate the directory where your c++ program executable is residing and type in following command from the command prompt. This will create a sub-directory where the command is executed and put all converted asp.net pages.

Development team is working on to provide you with an option to specify the target directory where the asp.net pages should be created.

syntax:

C:\your_program_directory>cpp2aspx yourprogram.exe

PS: cpp2aspx path is registered in PATH system-variable, so it will be available to you everywhere in the shell.

Note that this tool is broken and it sometimes fails to render proper markup involving GridView. but if your application is as simple as HelloWorld,then there's no doubt if it can create Response.Write("Hello-World"); accurately. If it does not work, then I'm afraid you'll have to rewrite your application in asp.net. It worked for me in most of the cases.

EDIT

As I write this, the next version that will support asp.net mvc is also under deveopment.

this. __curious_geek
I can picture the Google engineers pondering why all of the searches for cpp2aspx all of a sudden :)
Brian R. Bondy
This is mean!..
Sam Holder
this.__curious_geek.has_good_day == true :)
Rafal Ziolkowski
the question really made my weekend.
this. __curious_geek