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

Managed code with C# and VC++

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
3 3565
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

23
by: Bredal Jensen | last post by:
I want to port my MFC (VC++6) application to manageg VC ++. 7. I want to do this because some things are much better done with C#. So i could write a C# class and use in my VC++ code as Languague...
6
by: Shai Levi | last post by:
Hi, I'm trying to migrate native c++ class to managed c++ class. The native class header definition looks as: class NativeClass { public: typedef void (CbFunc1)(int n,void* p);
6
by: Itay_k | last post by:
Hello, I want a member in my class that will save pointer to pointer to System::Drawing::Image class. When I write on my class code: System::Drawing::Image **bmp; I get this error message:...
1
by: Omid Hodjati | last post by:
Hi All, I have an old unmanaged code written in C++ 6.0. This is a time critcal, CPU bound application. I have deciede migrate this application to managed world and VC++ 7.0. The first step was...
1
by: Eric Twietmeyer | last post by:
Hello, I'm starting to investigate cs, managed c++ and interoperating with a very large unmanaged code base. We are going to use Windows Forms (written in cs) to replace our old fashioned GUI. ...
1
by: Peter Nolan | last post by:
Hi All, I'm interested in the opinion of an expert or two on managed C++.net. I've been writing cross platform C++ (win/unix) for some ETL tools I use with clients. All the code is 'unmanaged'...
11
by: Peter Oliphant | last post by:
Is there any plan to support templates with managed code in the (near) future? For instance, VS.NET 2005... : )
5
by: Andy | last post by:
I'm having trouble accessing an unmanaged long from a managed class in VC++.NET When I do, the contents of the variable seem to be mangled. If I access the same variable byte-by-byte, I get the...
3
by: Klaus | last post by:
Hi, I have an existing VC 6 MFC application which communicates asynchronly with a VC 2005 managed code dll. I use an unmanaged base class with virtual functions to access methods in the MFC...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...

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.