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

Importing a C project into .NET, and book recommendations

I have files to build a C project, including the makefile, what's the
easiest way to import the project into C and C# in VS .NET Professional? I
have both VS .NET 2002 and 2003.

I have nothing but VB .NET books.
I guess it's time to get a book for each of C++ and C# in .NET.
Any recommendations

--
http://www.standards.com/; See Howard Kaikow's web site.
Nov 15 '05 #1
5 1496
Howard,

C# is not the same as C/C++. While there are many similarities, you can
not take the files from one and compile them in another and it will work (in
some cases yes, but in many, no).

If you have a lot of functionality in C/C++, then you might want to
consider accessing that functionality through the P/Invoke layer (if you
have functions exported from DLLs), COM interop (if you have objects exposed
through COM), or creating managed wrappers using Managed Extensions for C++
(if you have class libraries that don't fit into either of the conditions
above). Of course, you can do a conversion to C# if you have the time as
well, but the first three will save you more time, if you are under that
constraint.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Howard Kaikow" <ka****@standards.com> wrote in message
news:OA**************@TK2MSFTNGP12.phx.gbl...
I have files to build a C project, including the makefile, what's the
easiest way to import the project into C and C# in VS .NET Professional? I have both VS .NET 2002 and 2003.

I have nothing but VB .NET books.
I guess it's time to get a book for each of C++ and C# in .NET.
Any recommendations

--
http://www.standards.com/; See Howard Kaikow's web site.

Nov 15 '05 #2
Thanx.

Let me clarify.

The C code is not complex, just simple demonstrations of sorting algorithms.
It likely would not be difficult to start a C# or C++ project in .NET and
copy the code.
I was just hoping to find an easier way.

Should be someway to tell .NET to make a project from the makefile.

--
http://www.standards.com/; See Howard Kaikow's web site.
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:ek**************@tk2msftngp13.phx.gbl...
Howard,

C# is not the same as C/C++. While there are many similarities, you can not take the files from one and compile them in another and it will work (in some cases yes, but in many, no).

If you have a lot of functionality in C/C++, then you might want to
consider accessing that functionality through the P/Invoke layer (if you
have functions exported from DLLs), COM interop (if you have objects exposed through COM), or creating managed wrappers using Managed Extensions for C++ (if you have class libraries that don't fit into either of the conditions
above). Of course, you can do a conversion to C# if you have the time as
well, but the first three will save you more time, if you are under that
constraint.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Howard Kaikow" <ka****@standards.com> wrote in message
news:OA**************@TK2MSFTNGP12.phx.gbl...
I have files to build a C project, including the makefile, what's the
easiest way to import the project into C and C# in VS .NET
Professional? I
have both VS .NET 2002 and 2003.

I have nothing but VB .NET books.
I guess it's time to get a book for each of C++ and C# in .NET.
Any recommendations

--
http://www.standards.com/; See Howard Kaikow's web site.


Nov 15 '05 #3
Howard,

You can compile C++ code in .NET, but you will have to make some
adjustments. For example, if it is not object oriented code, then you will
have to make it so that it is (using static methods instead of having
functions, for example).

Also, I don't believe that the IDE knows about makefiles. Rather, you
will have to create a project file and add your files to the project.

You can still use NMAKE to compile your files with the makefile.
However, this will give you just what you had before, an unmanaged dll.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Howard Kaikow" <ka****@standards.com> wrote in message
news:eI**************@TK2MSFTNGP12.phx.gbl...
Thanx.

Let me clarify.

The C code is not complex, just simple demonstrations of sorting algorithms. It likely would not be difficult to start a C# or C++ project in .NET and
copy the code.
I was just hoping to find an easier way.

Should be someway to tell .NET to make a project from the makefile.

--
http://www.standards.com/; See Howard Kaikow's web site.
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in message news:ek**************@tk2msftngp13.phx.gbl...
Howard,

C# is not the same as C/C++. While there are many similarities, you

can
not take the files from one and compile them in another and it will work

(in
some cases yes, but in many, no).

If you have a lot of functionality in C/C++, then you might want to
consider accessing that functionality through the P/Invoke layer (if you
have functions exported from DLLs), COM interop (if you have objects

exposed
through COM), or creating managed wrappers using Managed Extensions for

C++
(if you have class libraries that don't fit into either of the conditions above). Of course, you can do a conversion to C# if you have the time as well, but the first three will save you more time, if you are under that
constraint.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Howard Kaikow" <ka****@standards.com> wrote in message
news:OA**************@TK2MSFTNGP12.phx.gbl...
I have files to build a C project, including the makefile, what's the
easiest way to import the project into C and C# in VS .NET

Professional?
I
have both VS .NET 2002 and 2003.

I have nothing but VB .NET books.
I guess it's time to get a book for each of C++ and C# in .NET.
Any recommendations

--
http://www.standards.com/; See Howard Kaikow's web site.



Nov 15 '05 #4
You know the other way of looking at it is that you will probably learn C#
as you port your code.

Making lemonade, ya know,

doug

"Howard Kaikow" <ka****@standards.com> wrote in message
news:eI**************@TK2MSFTNGP12.phx.gbl...
Thanx.

Let me clarify.

The C code is not complex, just simple demonstrations of sorting algorithms. It likely would not be difficult to start a C# or C++ project in .NET and
copy the code.
I was just hoping to find an easier way.

Should be someway to tell .NET to make a project from the makefile.

--
http://www.standards.com/; See Howard Kaikow's web site.
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in message news:ek**************@tk2msftngp13.phx.gbl...
Howard,

C# is not the same as C/C++. While there are many similarities, you

can
not take the files from one and compile them in another and it will work

(in
some cases yes, but in many, no).

If you have a lot of functionality in C/C++, then you might want to
consider accessing that functionality through the P/Invoke layer (if you
have functions exported from DLLs), COM interop (if you have objects

exposed
through COM), or creating managed wrappers using Managed Extensions for

C++
(if you have class libraries that don't fit into either of the conditions above). Of course, you can do a conversion to C# if you have the time as well, but the first three will save you more time, if you are under that
constraint.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Howard Kaikow" <ka****@standards.com> wrote in message
news:OA**************@TK2MSFTNGP12.phx.gbl...
I have files to build a C project, including the makefile, what's the
easiest way to import the project into C and C# in VS .NET

Professional?
I
have both VS .NET 2002 and 2003.

I have nothing but VB .NET books.
I guess it's time to get a book for each of C++ and C# in .NET.
Any recommendations

--
http://www.standards.com/; See Howard Kaikow's web site.



Nov 15 '05 #5
I found something in the online Help yesterday about using File | Open
Workspace, and the IDE did open the makefile, but then I could not figure
out what to do.

I spent a lot of time searching through the .NET Help to no avail.
Surely, the importing of the vast amount of extant code has to be a high
priority item.

But I've not been able to find out how to do the deed.

I do have an old copy of VS C/C++ 6 learning editions that came with books.
I could build a project there and then let .NET import the critter, but
there should be a more direct way.

--
http://www.standards.com/; See Howard Kaikow's web site.
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:Oh**************@TK2MSFTNGP10.phx.gbl...
Howard,

You can compile C++ code in .NET, but you will have to make some
adjustments. For example, if it is not object oriented code, then you will have to make it so that it is (using static methods instead of having
functions, for example).

Also, I don't believe that the IDE knows about makefiles. Rather, you
will have to create a project file and add your files to the project.

You can still use NMAKE to compile your files with the makefile.
However, this will give you just what you had before, an unmanaged dll.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Howard Kaikow" <ka****@standards.com> wrote in message
news:eI**************@TK2MSFTNGP12.phx.gbl...
Thanx.

Let me clarify.

The C code is not complex, just simple demonstrations of sorting

algorithms.
It likely would not be difficult to start a C# or C++ project in .NET and
copy the code.
I was just hoping to find an easier way.

Should be someway to tell .NET to make a project from the makefile.

--
http://www.standards.com/; See Howard Kaikow's web site.
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote

in
message news:ek**************@tk2msftngp13.phx.gbl...
Howard,

C# is not the same as C/C++. While there are many similarities, you
can
not take the files from one and compile them in another and it will
work (in
some cases yes, but in many, no).

If you have a lot of functionality in C/C++, then you might want
to consider accessing that functionality through the P/Invoke layer (if you have functions exported from DLLs), COM interop (if you have objects

exposed
through COM), or creating managed wrappers using Managed Extensions for C++
(if you have class libraries that don't fit into either of the

conditions above). Of course, you can do a conversion to C# if you have the time as well, but the first three will save you more time, if you are under

that constraint.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Howard Kaikow" <ka****@standards.com> wrote in message
news:OA**************@TK2MSFTNGP12.phx.gbl...
> I have files to build a C project, including the makefile, what's the > easiest way to import the project into C and C# in VS .NET

Professional?
I
> have both VS .NET 2002 and 2003.
>
> I have nothing but VB .NET books.
> I guess it's time to get a book for each of C++ and C# in .NET.
> Any recommendations
>
> --
> http://www.standards.com/; See Howard Kaikow's web site.
>
>



Nov 15 '05 #6

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

Similar topics

8
by: Poonam | last post by:
Hi, Can some one please help me with (or point me to) a very simple but working code sample that shows how to import XML Schema. I have tried many samples out there on internet but nothing seems...
1
by: em | last post by:
Hi all, I'm getting some problems importing a DLL that I made in C# within VB6.0. The C# is quite easy, just for trying: namespace TestDll { public class Class1
4
by: Mike | last post by:
Hi, I am planning on purchasing VS2005 to learn C# very soon, and I need good book recommendations. I realize this is a question that may be asked a lot, but please consider my background: I...
4
by: Howard Kaikow | last post by:
I have files to build a C project, including the makefile, what's the easiest way to import the project into C and C# in VS .NET Professional? I have both VS .NET 2002 and 2003. I have nothing...
3
by: Ryu | last post by:
Hi all, Is it possible to create a dll project of ascx controls? I have tried creating a dll project and then adding ascx files. But I cant view them in design mode. Neither can I attach the its...
1
by: Billy Biro | last post by:
Hi. I'm looking for some recommendations for Visual Basic 2005 books. Specifically, I'm NOT looking for books that detail the elements of the language, nor explain OOP, but rather present...
4
by: Neil Landau | last post by:
Hi all, I'd like to ask for book recommendations, please. I'm a VB guy looking to move to C#. I have quite a fair amount of experience of VB.NET (and prior to that, VB4 through VB6), so I'm...
10
by: SusanV | last post by:
Time to learn something new, anyone have any recommendations for a good reference book on ASP.Net? Also recommendations on AJAX would be most welcome. TIA, SusanV
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.