By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,673 Members | 1,209 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,673 IT Pros & Developers. It's quick & easy.

Managed code with C# and VC++

P: n/a
I am trying to find the simplest possible way of writing a
GUI to run on top of a standard C++ library written in
VC++. I would like to avoid MFCs, COM, and if
possible .Net wrappers. The goal is just to be able to
demonstrate the capabilities of the library, rather than
create a finished product.

I have read things here and there about "managed code",
where you can write a GUI in C# to interface with
C++ "unmanaged" code. However, after searching through
pages and pages on MSDN, plus external sites, I remain
more confused than ever. If anyone could help answer the
following questions, or point me to some useful references
on the web or in print, I would greatly appreciate it.

1. Does managed/unmanaged code (using C# and VC++) allow
you to bypass MFCs and COM?

2. If so, is it still necessary to write some type of .Net
wrapper to instantiate the C++ objects?

3. Can this be done with the standard .Net 2003 versions
of C# and VC++, or does it require purchasing .Net
Professional?

Again, any feedback or references would be appreciated.

Thanks in advance.

Nov 13 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Francis,

See inline:

"Francis Urquhart" <fr**************@yahoo.co.jp> wrote in message
news:09****************************@phx.gbl...
I am trying to find the simplest possible way of writing a
GUI to run on top of a standard C++ library written in
VC++. I would like to avoid MFCs, COM, and if
possible .Net wrappers. The goal is just to be able to
demonstrate the capabilities of the library, rather than
create a finished product.

I have read things here and there about "managed code",
where you can write a GUI in C# to interface with
C++ "unmanaged" code. However, after searching through
pages and pages on MSDN, plus external sites, I remain
more confused than ever. If anyone could help answer the
following questions, or point me to some useful references
on the web or in print, I would greatly appreciate it.

1. Does managed/unmanaged code (using C# and VC++) allow
you to bypass MFCs and COM?
Yes, it does. You can write managed code which accesses unmanaged code,
but that unmanaged code has to provide a managed interface of some sort.

2. If so, is it still necessary to write some type of .Net
wrapper to instantiate the C++ objects?
Yes, it is. Otherwise, the runtime would have no clue how to interact
with the unmanaged code.

3. Can this be done with the standard .Net 2003 versions
of C# and VC++, or does it require purchasing .Net
Professional?
You should be able to do it without the IDE, you should be able to do it
with just the .NET framework (although it would be a little more difficult,
as everything is from the command line).

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- ni**************@exisconsulting.com

Again, any feedback or references would be appreciated.

Thanks in advance.

Nov 13 '05 #2

P: n/a
Francis,

I would definitely use C# for the GUI code. It would probably be easier
(IMO), but it all depends on what you are used to. If you can create the
wrappers for your classes, then you really have 95% of the work done, as
there is little to do after that besides create the GUI. If you have
complex GUI requirements, then I would use C++, but if your requirements are
pretty standard, then I would use C# to call your wrapped classes.
--
- Nicholas Paldino [.NET/C# MVP]
- ni**************@exisconsulting.com

"Francis Urquhart" <fr**************@yahoo.co.jp> wrote in message
news:0e****************************@phx.gbl...
Nicholas,

Thanks for your reply. That definitely helps.

Just one follow-up: Would you recommend the C# route
rather than just trying to create a GUI using VC++ alone?
That is, would it be a simpler process to create the .Net
wrapper and code the GUI in C# rather than using the GUI
tools in VC++ (especially if I were to use the .Net
Professional IDE)?

Sorry for all the questions -- I've been working with UNIX
the past five years and know very little about the .Net
environment.

-Francis

-----Original Message-----
Francis,

See inline:

"Francis Urquhart" <fr**************@yahoo.co.jp> wrote

in message
news:09****************************@phx.gbl...
I am trying to find the simplest possible way of writing a GUI to run on top of a standard C++ library written in
VC++. I would like to avoid MFCs, COM, and if
possible .Net wrappers. The goal is just to be able to
demonstrate the capabilities of the library, rather than
create a finished product.

I have read things here and there about "managed code",
where you can write a GUI in C# to interface with
C++ "unmanaged" code. However, after searching through
pages and pages on MSDN, plus external sites, I remain
more confused than ever. If anyone could help answer the following questions, or point me to some useful references on the web or in print, I would greatly appreciate it.

1. Does managed/unmanaged code (using C# and VC++) allow
you to bypass MFCs and COM?


Yes, it does. You can write managed code which

accesses unmanaged code,
but that unmanaged code has to provide a managed

interface of some sort.

2. If so, is it still necessary to write some type of .Net wrapper to instantiate the C++ objects?


Yes, it is. Otherwise, the runtime would have no

clue how to interact
with the unmanaged code.

3. Can this be done with the standard .Net 2003 versions
of C# and VC++, or does it require purchasing .Net
Professional?


You should be able to do it without the IDE, you

should be able to do it
with just the .NET framework (although it would be a

little more difficult,
as everything is from the command line).

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- ni**************@exisconsulting.com

Again, any feedback or references would be appreciated.

Thanks in advance.

.

Nov 13 '05 #3

P: n/a
Nicholas,

Thanks for your reply. That definitely helps.

Just one follow-up: Would you recommend the C# route
rather than just trying to create a GUI using VC++ alone?
That is, would it be a simpler process to create the .Net
wrapper and code the GUI in C# rather than using the GUI
tools in VC++ (especially if I were to use the .Net
Professional IDE)?

Sorry for all the questions -- I've been working with UNIX
the past five years and know very little about the .Net
environment.

-Francis

-----Original Message-----
Francis,

See inline:

"Francis Urquhart" <fr**************@yahoo.co.jp> wrote in messagenews:09****************************@phx.gbl...
I am trying to find the simplest possible way of writing a GUI to run on top of a standard C++ library written in
VC++. I would like to avoid MFCs, COM, and if
possible .Net wrappers. The goal is just to be able to
demonstrate the capabilities of the library, rather than
create a finished product.

I have read things here and there about "managed code",
where you can write a GUI in C# to interface with
C++ "unmanaged" code. However, after searching through
pages and pages on MSDN, plus external sites, I remain
more confused than ever. If anyone could help answer the following questions, or point me to some useful references on the web or in print, I would greatly appreciate it.

1. Does managed/unmanaged code (using C# and VC++) allow
you to bypass MFCs and COM?
Yes, it does. You can write managed code which

accesses unmanaged code,but that unmanaged code has to provide a managed interface of some sort.

2. If so, is it still necessary to write some type of .Net wrapper to instantiate the C++ objects?
Yes, it is. Otherwise, the runtime would have no

clue how to interactwith the unmanaged code.

3. Can this be done with the standard .Net 2003 versions
of C# and VC++, or does it require purchasing .Net
Professional?
You should be able to do it without the IDE, you

should be able to do itwith just the .NET framework (although it would be a little more difficult,as everything is from the command line).

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- ni**************@exisconsulting.com

Again, any feedback or references would be appreciated.

Thanks in advance.

.

Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.