PC Review


Reply
Thread Tools Rate Thread

Converting a C program to C#

 
 
Gilgamesh
Guest
Posts: n/a
 
      15th Jan 2007
I have a program written in C which I need to convert it to C#. This program
includes about six header files and it makes calls to functions which havee
been defined in other C programs . How can I convert only this program to C#
without bothering about other C programs used by this program? Do I need to
just add the include files in the project? What's the best way to develop
this?

Any feedback will be greatly appreaicted.

Thanks,
Gilgamesh


 
Reply With Quote
 
 
 
 
=?Utf-8?B?VGhlTWFkSGF0dGVy?=
Guest
Posts: n/a
 
      15th Jan 2007

Perhaps start from scratch.? (realistic.)

You whould have to atleast list the program that you are trying to convert.
We havent a clue as to the scope of your program.

I have to warn you, c code and managed c# code can be completely different
beasts.

As for the rest of your classes, if they are in a dll, you most likely could
reuse them.

If your code works just fine, why convert?



"Gilgamesh" wrote:

> I have a program written in C which I need to convert it to C#. This program
> includes about six header files and it makes calls to functions which havee
> been defined in other C programs . How can I convert only this program to C#
> without bothering about other C programs used by this program? Do I need to
> just add the include files in the project? What's the best way to develop
> this?
>
> Any feedback will be greatly appreaicted.
>
> Thanks,
> Gilgamesh
>
>
>

 
Reply With Quote
 
Ashot Geodakov
Guest
Posts: n/a
 
      15th Jan 2007
Not sure about C#, but you can always compile this project with added CLR
support.

Right-click on project => Properties => Common Language Runtime support =>
Select CLR support in the combo box => Apply.

I can guarantee it will not compile at once. You will need to change other
project's settings. Read MSDN (Common Language Runtime Compilation), which
will explain a bit.

Once this compiles successfully, you can define managed C++ classes in it.
This will turn the project into a .Net class library assembly. Then you can
add references to this assembly in other projects, C# or Vb.Net.


"Gilgamesh" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
>I have a program written in C which I need to convert it to C#. This
>program includes about six header files and it makes calls to functions
>which havee been defined in other C programs . How can I convert only this
>program to C# without bothering about other C programs used by this
>program? Do I need to just add the include files in the project? What's the
>best way to develop this?
>
> Any feedback will be greatly appreaicted.
>
> Thanks,
> Gilgamesh
>



 
Reply With Quote
 
Mark Rae
Guest
Posts: n/a
 
      16th Jan 2007
"Gilgamesh" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...

>I have a program written in C which I need to convert it to C#.


Why? Has it stopped working...?

> This program includes about six header files


*About* six...? Is that five, six, seven...? Do you not actually know how
many headers are included...? You will need to get a complete picture of
what the C program is doing before you can proceed with this...

> and it makes calls to functions which have been defined in other C
> programs.


And what are they...?

> How can I convert only this program to C#


Impossible to advise you with the level of information you've provided so
far...


 
Reply With Quote
 
Michael A. Covington
Guest
Posts: n/a
 
      16th Jan 2007
Despite similar syntax, C and C# are radically different languages. C uses
pointers extensively but C# does not (instead, pointer-like things are done
for you by the object-oriented type system). Unless the conversion is
necessary for some reason, I would recommend not doing it.



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help converting a C program to VB.NET or VFP Edhy Rijo Microsoft VB .NET 2 6th Apr 2007 02:23 PM
Help converting a C program to VB.NET or VFP Edhy Rijo Microsoft VC .NET 6 6th Apr 2007 02:23 PM
Converting VB DDE Client program to VC++ =?Utf-8?B?Q2luZHk=?= Microsoft VC .NET 3 26th Jan 2007 02:46 AM
Which program is best for converting cassettes to CDs =?Utf-8?B?bGVhZHBpcGU=?= Windows XP Music 1 24th Jan 2005 04:41 AM
Re: Converting old data into new program Otto Moehrbach Microsoft Excel Misc 0 29th Sep 2003 10:26 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:31 AM.