From: David Ching on
"Bruno van Dooren [MVP VC++]" <bruno_nos_pam_van_dooren(a)hotmail.com> wrote
in message news:uWMBC2eTHHA.4276(a)TK2MSFTNGP02.phx.gbl...
> In that case I would write the low-level functions in C++, and package
> them in a DLL with C style exported functions that you can then simply
> invoke in a C# app.
> Another solution is to Create a COM component in C++ with the low level
> routines.
> If the method prototypes are valid for creating a type library, you could
> reuse that COM component in C# without having do do anything special.
> Gluecoe will be generated for you in that case.
>
> Either of those 2 will give you the RAD of C# and the power of C++.
>

Bruno, since I have over 15 years of C++ experience, I'm finding the easiest
way to do WinForms is with VC2005 C++/CLI. Other than the tools like
refactoring, what does C# buy you that C++/CLI does not have for building
WinForms apps?

I like the ability to just call my native C++ classes as usual. I had to
write a CNativeString class to marshall C-style strings to .NET String but
that's it. No PInvoke, no nothing, just call the native C++ class.

I will eventually learn C# because the ecosystem of .NET seems to revolve
around it, but I don't see why C++/CLI would not be a first choice for
WinForms coming from a C++ background and with a high priority of
interfacing to native C++ code.

Thanks,
David (MVP)


From: Joseph M. Newcomer on

On Sat, 10 Feb 2007 22:21:51 -0800, flect <flect(a)aol.com> wrote:

>Steven O. wrote:
>> Short version: I will be creating stand-alone applications for
>> Windows. Which environment will make it quicker and easier for me to
>> create the necessary GUI's -- Visual C++ or Visual C#?
>>
>> Longer version: I took a bunch of programming classes some years
>> back, including two semesters of C++, but I've been away from it for a
>> while. One thing I found with C++ was that trying to create even a
>> basic GUI using Visual Studio 6 with MFC was an absolute bear.
>>
>> I now plan to develop some simple scientific and mathematical
>> applications, mostly for self-study purposes, but some of them may
>> turn commercial at some point. The guts of the programs will be the
>> mathematical logic and processing, but I do need a GUI front-end for
>> data input, setting parameters, results display, etc. I've downloaded
>> both Visual C++ Express and Visual C# Express, but haven't explored
>> them yet, and I'm trying to decide which one to pursue.
>>
>> In terms of underlying code for program logic, I'd prefer to work in
>> C++, both because I know it already, and because it is more universal
>> than C#. (So, for example, it would be easier to port the code to
>> some other environment down the road.) On the other hand, I don't
>> want to waste time learning GUI programming again.
>>
>> I want to be able to slap together a basic GUI using drag-and-drop
>> style development for GUI components. A very quick peek at Visual C++
>> Express does not immediately reveal a drag-and-drop development tool,
>> but I may have missed something. (Have not even installed Visual C#
>> Express yet.) So, in the end, I'll go with whichever language makes
>> its easier to put the GUI together, and if that means learning C#,
>> I'll do that.
>>
>> I guess a related issue would be, it would help to use software where
>> saving data structures to a file, and retrieving them from a file, is
>> straightforward. Again, that was a real issue with MFC, so it would
>> help to know if the latest Visual C++ environment makes that easier,
>> or if I am better off with C# in that respect. In a sense, I'm
>> looking for the ease of front end and file processing that comes with
>> VB, but with the advanced data structure capabilities I associate with
>> C++. So, again -- the latest Visual C++, or Visual C#?
>>
>> Any and all input is much appreciated. Please point me in the right
>> direction....
>>
>> Steve O.
>>
>
>The short version: C#.method is Microsoft-specific.
****
The short counter: and using MFC isn't? Wrting to the raw Win32 API isn't?
joe
Joseph M. Newcomer [MVP]
email: newcomer(a)flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
From: Joseph M. Newcomer on
I used to teach a Win16, then Win32 API programming course. I also taught an MFC course.
In the Win16/Win32 courses, we could get the students to create an app that vaguely
resembled a proper Windows application by late Wednesday afternoon. No menu prompts, no
toolbars, no status bar, but hey, it almost worked right.

In the MFC course, the first lab is "build an MFC application". It takes 5 minutes to get
to where we were after three days, and our first app is built before the morning break.
ANd it has toolbar, status bar, menu prompts, etc.

The cost for the low-end version of VS should justify going for the real thing. I was
buying the Microsoft C/C++/MFC system from my personal funds back when it was a great deal
more expensive than it is today (allowing for inflation). Free software is often worth
exactly what you pay for it.
joe
On Sun, 11 Feb 2007 15:36:45 GMT, MrAsm <mrasm(a)usa.com> wrote:

>On Sun, 11 Feb 2007 02:18:35 GMT, Steven O. <null(a)null.com> wrote:
>
>>I now plan to develop some simple scientific and mathematical
>>applications, mostly for self-study purposes, but some of them may
>>turn commercial at some point. The guts of the programs will be the
>>mathematical logic and processing, but I do need a GUI front-end for
>>data input, setting parameters, results display, etc. I've downloaded
>>both Visual C++ Express and Visual C# Express, but haven't explored
>>them yet, and I'm trying to decide which one to pursue.
>
>I believe that with Visual C++ Express you *can't* use MFC. You may
>download the Platform SDK (separate download) and develop your GUI
>code using that SDK (not MFC).
>
>But if you find it hard to develop GUIs using VC6 and MFC (with all
>the wizards and IDE support), I think you will have hard-time to
>develop using "pure" Win32 Platform SDK...
>
>
>>In terms of underlying code for program logic, I'd prefer to work in
>>C++, both because I know it already, and because it is more universal
>>than C#. (So, for example, it would be easier to port the code to
>>some other environment down the road.)
>
>There are C# projects in development under GNU/Linux (like Mono and
>DotGNU). But I don't know their level of compatibility with
>Microsoft's C# and IDE...
>
>
>> On the other hand, I don't
>>want to waste time learning GUI programming again.
>
>If you don't want to learn GUI programming, then choosing Visual C#
>2005 Express would be a better option.
>It's just drag-and-drop and add event handlers... :) Very RAD.
>
>
>>I want to be able to slap together a basic GUI using drag-and-drop
>>style development for GUI components. A very quick peek at Visual C++
>>Express does not immediately reveal a drag-and-drop development tool,
>>but I may have missed something. (Have not even installed Visual C#
>>Express yet.) So, in the end, I'll go with whichever language makes
>>its easier to put the GUI together, and if that means learning C#,
>>I'll do that.
>
>So you should learn C#.
>
>And consider also that C# is basically C++ without pointers and with
>some interesting features (like garbage collector, built-in
>reflection, a huge library - the .NET framework, etc.)
>
>However, if you want to implement very complex data structures, you
>may also consider support of libraries like STL or Boost. In this
>case, for what I know, you have to use C++ (maybe there's a STL.NET,
>but I think it is under development...).
>
>I think that building the core of your app in C++ and building the GUI
>using C# RAD-system, and call C++ code from C# (using C-interface DLL
>or COM) would be the best choice for you.
>
>MrAsm
Joseph M. Newcomer [MVP]
email: newcomer(a)flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
From: Ian Semmel on


"MrAsm" <mrasm(a)usa.com> wrote in message
news:teius2548cfe6qde07a84i4nkb5731da93(a)4ax.com...
> On Sun, 11 Feb 2007 08:03:30 +0100, "Bruno van Dooren [MVP VC++]"
> <bruno_nos_pam_van_dooren(a)hotmail.com> wrote:
>
>>> Short version: I will be creating stand-alone applications for
>>> Windows. Which environment will make it quicker and easier for me to
>>> create the necessary GUI's -- Visual C++ or Visual C#?
>>
>>See my blog for an explanation of when I would use either C++ or C#, based
>>on their strengths and weaknesses.
>
> In your opinion, do you think that would be possible to buil some
> "important" software like Office or Visual Studio or Mathematica using
> C#? (...and don't require to user wait long time for app start-up or
> computations.)
>
> Thanks in advance,
> MrAsm

You can write anything in C# and it is not that slow to start up. Look at
Paint.NET.

I think they use native code for some critical parts.


From: Bruno van Dooren [MVP VC++] on
> Bruno, since I have over 15 years of C++ experience, I'm finding the
> easiest way to do WinForms is with VC2005 C++/CLI. Other than the tools
> like refactoring, what does C# buy you that C++/CLI does not have for
> building WinForms apps?

If you are a die hard C++ programmer, I can easily imagine that C++/CLI and
winforms comes naturally to you.
With 15 years of experience and an MFC background (I guess this), C++/CLI
winforms was made for you.

But for Orcas, C# and VB.NET (barf) will get a lot of cool new features.
VC++ doesn't.
LINQ will be C# and VB only.
WPF IDE functionality will be C# and VB only. WCF and WF also.
Refactoring and powerful IDE features... C# and VB only.

Starting from Orcas, C++/CLI is placed at a disadvantage.
Technically, you could do WPF by hand, manually creating all code and markup
scripts.
LINQ is sugar on top of .NET features, so you could emulate it using raw
..NET calls...

But all of this is a serious productivity impairment.

Lets forget about VB for a while (a long while :-)) and highlight C#.
If I can do a siginificant portion of a project in C#, my clients are happy
because it is far easier for me to hand over the project to one of their
programmers than if I had used C++/CLI, which almost noone knows.
There are tons of code examples for C#.
Intellisense and code completion works. Always. Really.
The C# IDE is crammed with productivity features.

For C++ programmers, learning C# should be a breeze. it was for me. It's
like C++ with training wheels and airbags.

--

Kind regards,
Bruno van Dooren
bruno_nos_pam_van_dooren(a)hotmail.com
Remove only "_nos_pam"