B
Bruce Schechter
Background: I have nearly two years of experience with C# and the .NET
framework, as well as a fair amount of C experience from many years ago, but
no C++ background (until about two months ago.) Now, I am helping a team
develop an application with a UI based on C# and business logic coded in
C++. The choice of C++ is because the team has several key elements of the
business logic already coded in VC++ (from pre- .NET tools.)
Ideally I'd like to compile the final project altogether within vs.net 2003,
in which I'd combine the C# UI project with the C++ business layer project
resulting in one .NET executable. But after reading up on these topics in
MSDN, I've run into some issues about which I need advice regarding these
two points:
1.) It looks like the only way to combine the C++ code into the .NET project
is to convert it into "managed code" (which involves quite a bit of
modifications to the C++ source, like tagging each class with the __gc
modifier, etc.) Is that a correct understanding/assessment? Sounds like a
tedious job on the C++ side, and would totally "break" our ability to
re-use the C++ in future non-.NET projects, correct? Is there a mechanism
to write C++ code that can be conditionally compiled as either managed or
not managed?
2.) I gather that we could compile the C++ modules into one DLL and then
access it from the .NET project using some kind of wrapper?? I frankly don'
t fully understand what this means. Could someone recommend a link to a
good article on this topic?
Which of these paths makes the most sense, if we want to keep the C++ code
in standard (as close as possible to ANSI standard) format for potential
portability? Am I missing any other good approaches to the overall
strategy?
Thanks,
Bruce
framework, as well as a fair amount of C experience from many years ago, but
no C++ background (until about two months ago.) Now, I am helping a team
develop an application with a UI based on C# and business logic coded in
C++. The choice of C++ is because the team has several key elements of the
business logic already coded in VC++ (from pre- .NET tools.)
Ideally I'd like to compile the final project altogether within vs.net 2003,
in which I'd combine the C# UI project with the C++ business layer project
resulting in one .NET executable. But after reading up on these topics in
MSDN, I've run into some issues about which I need advice regarding these
two points:
1.) It looks like the only way to combine the C++ code into the .NET project
is to convert it into "managed code" (which involves quite a bit of
modifications to the C++ source, like tagging each class with the __gc
modifier, etc.) Is that a correct understanding/assessment? Sounds like a
tedious job on the C++ side, and would totally "break" our ability to
re-use the C++ in future non-.NET projects, correct? Is there a mechanism
to write C++ code that can be conditionally compiled as either managed or
not managed?
2.) I gather that we could compile the C++ modules into one DLL and then
access it from the .NET project using some kind of wrapper?? I frankly don'
t fully understand what this means. Could someone recommend a link to a
good article on this topic?
Which of these paths makes the most sense, if we want to keep the C++ code
in standard (as close as possible to ANSI standard) format for potential
portability? Am I missing any other good approaches to the overall
strategy?
Thanks,
Bruce