C++ and form application programming

S

Shane Stevens

Can anyone please point me towards a book specialising in Windows Forms
programming C++, NOT C# or VB.NET?

I am a very experienced programmer migrating from MFC to the .NET framework
and i'm having a hard time finding good C++ code. Everything is in C# or
VB.NET!

Any help would be greatly appreciated.

Regards,
Shane
 
S

Stu Smith

This isn't going to answer your question but what's the reason you want to
write windows forms code in MC++? I would have thought that would be rather
painful, compared to using C# or VB.NET.

However, since it's the framework you want to learn, then you're probably
best looking at some C# examples and translating the language.

Stu
 
F

Flare

I am a very experienced programmer migrating from MFC to the .NET
framework

If you are very experienced programmer you should find no problems
converting to C# unless you have sone very good arguments choosing C++. It´s
rather cumbersome to use C++ in manged conditions. But if you require eg.
multiinheritance or other c++ specialties you could be a point. But if the
reason is that you feel "home" in C++ i think the week or two you use
converting your knowledge is very well spend compared to the productivity
you would gain with C#.

But tells us more about way you would want to use C++.

Regards
Anders Jaocbsen
 
N

Niki Estner

Considering the docs, samples and the language design of MC++ I always
assumed it's more for backwards compatiblity and unmanaged-code-interacion
scenarios; Noone I know really LIKES writing managed code in C++: all those
__gc, __value, __(un)box... special keywords make the code unreadable, and
you always have to look twice wheater you need to free/delete an object or
leave it to the GC... (not even mentioning advanced topics like pinning).
If you really have to use MC++ I'd suggest learning Windows Forms 'the easy
way' in C#, and then looking at the C# - MC++ translation (which is pretty
straightforward).

Not sure if this helps though...

Niki
 
S

Shane Stevens

I know I can convert, and have been, however it is time consuming. Clearly
there is an inherent latency in conversion. I would rather stay in C++ -
land, just as C# / VB.NET programmers want to stay in theirs.

Also, I mix vanilla C++ with managed which involves a few caveats when
dealing with objects on different heaps.

The reason I mix is becuase I have a large library of C++ code which lives
perfectly happily alongside managed classes. I mainly want to use .NET for
the UI, XML classes. Yes, I could just stick to using MFC, but we all have
to start somewhere and I am happy to leave all of my backend code as C++ and
begin learning the .NET framework in small doses.

By the way, I think there is a misconception that it's significantly easier
to use the .Net framework in langauges other than C++, which simply isn't
true. I haven't run into any problems yet at all. Also, consider mixing
C++ and C#. C# obviously can't access C++ structures/classes, so moving
from C++ is a backwards step. Don't get be wrong, I really like C#, and
wouldnt use that for any code I write for web development, such as aspx, but
for desktop application development I am very happy/fast with C++. IE: Just
because I change to .NET doesn't mean I need to change languages.

So, I just want a nice .NET framework application programming reference book
on my desk, just like i've got for MFC. I would much rather invest the time
now in learning and using the .NET framework than continuing down the MFC
path.

Regards,
Shane

PS: Does anyone know how I can added my own control types to a PropertyGrid?
( In C++ ;) )
 
S

Shane Stevens

"you always have to look twice wheater you need to free/delete an object or
leave it to the GC"

I know! That is one of my biggest worries. Just setting a managed pointer
to NULL, or doing nothing at all, is VERY scary. :| The other keywords
aren't so bad... itsn't only when you are moving between managed/unmanaged,
which is separated very clearly in my code.

Basically the way I mix MC++/C++ is to use MC++ for the UI and unmanaged for
everything else. I use C++ because I have so much code already written
using C++, such as my kernel/maths/file/container libraries. I would have
to port those to C# which is FAR from a trivial job and I wouldn't want to
anyway.

I guess if C# could somehow call C++ it might make it easier, but I still
couldn't have this in my C# code:

TVector4 v1,v2;
float fAng = TVector4::DotProduct(v1, v2)

Regards,
Shane
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top