Hello all.
I'm new to C++ (took a C++ class at college a few years back-2001, and am
just returning to update console appl. I created back then. I got that to
work last night, finally), and want to update a console application to a
full-blown windows program.
I'm presently using MS Visual Studio C++ Express 2008.
I've already "created" my gui's using the drag/drop utility in Express.
My initial question is where can I read up on how to "link" all my forms to:
1- my base code.
2- I have three functions, which will use three (one form each) forms. So I
need to link the forms back to my main "intro." form.
I'll admit right now I'd like to minimze the amount of frustration I'll
have, but am willing to take the time to do what I must to have a
fully-working windows program.
Thank you in advance for your helps.
Best.
SteveB.

Re: link gui's by Scott

Scott
Fri Jul 11 10:47:44 CDT 2008

"SteveDB1" <SteveDB1@discussions.microsoft.com> wrote in message
news:DD7DAA5D-035B-4D3A-BA1D-7BFF89C84180@microsoft.com...
> Hello all.
> I'm new to C++ (took a C++ class at college a few years back-2001, and am
> just returning to update console appl. I created back then. I got that to
> work last night, finally), and want to update a console application to a
> full-blown windows program.
> I'm presently using MS Visual Studio C++ Express 2008.
> I've already "created" my gui's using the drag/drop utility in Express.
> My initial question is where can I read up on how to "link" all my forms
> to:
> 1- my base code.
> 2- I have three functions, which will use three (one form each) forms. So
> I
> need to link the forms back to my main "intro." form.
> I'll admit right now I'd like to minimze the amount of frustration I'll
> have, but am willing to take the time to do what I must to have a
> fully-working windows program.
> Thank you in advance for your helps.
> Best.
> SteveB.


A console program executes continuously, maintaining control at all times.
A windows program does not - it must be "event driven." This means that
converting a console program to an Windows program requires a complete
rewrite. The fundamental program structures and flows are very different.

Your best course is to study a book or two on C++ Windows programming,
learning how windows and messages work. Then and only then can you develop
the event-driven framework for the windows that you want, and then add in
your algorithms from the console program.

You may also find that working with the Express edition is not enough for
productive programming of a Windows app. A class library can help a lot,
but unfortunately these give you even more of a learning curve. If you tell
us a bit about why you are doing this and what you want to get out of it you
might get some more specific suggestions.

--
Scott McPhillips [VC++ MVP]


Re: link gui's by SteveDB1

SteveDB1
Fri Jul 11 12:11:00 CDT 2008

Express Not enough.... now why does that not surprise me.

As to why/what.... how much time have you got?
Essentially, I came across a problem in my former career as a sheet metal
mechanic, and when I returned to school, I learned math/physics, excel, and
C++. I first solved the problem in excel, then once I learned C++, school
style, I began tinkering until I found the solution, with a console appl.

At a specific point I realized that this would have limited value, as I
wanted to sell it to former coleagues, and those still in the trade with a
use for it. So creating a "windows app" seemed the most beneficial. Using
VS6.0 C++, and eventually J+, I began creating GUI's by drag/drop, until I
hit the present snag/wall I face (my reason for coming here, but back in
2001).

I eventually spoke with my C++ TA at school, and paid him to "link it all
together" so it would work. Two weeks later he handed me a floppy disk with a
MS J+ jvm program that was "windows friendly" and could work "cross
platform."

This worked great, and after posting it on a website, I began receiving good
reviews. Then came the day NTFS made it passed NT into XP.
After that it ceased working, and I was left with a useless exe file. Since
I had no means at the time to update it, I let it go. No amount of updating
jvm, or anything else helped.

Last year a buddy of mine who does some programming told me about Java's,
then new, NetBeans IDE, and I tried using that, with no luck because of my
limited programming knowledge/skills.

Two months ago I read about WidgetsWX using C++ to allow a Java conversion
(for cross platform viability), so I came back to once again make a go of
this-- for me this time, and its updating. Now that I've decided to come back
and see if I could update it, I need to learn this, as I don't know of any
more programmers whom I could hand a handfull of cash to do it for me. And
while I could track one down, I've become sufficiently curious about
programming, and am using VBA in Excel more now with my work, that I'd really
like to learn.

Sorry for the long-windedness, but that's both why and what.
Thanks for your response.
Best.


"Scott McPhillips [MVP]" wrote:

> You may also find that working with the Express edition is not enough for
> productive programming of a Windows app. A class library can help a lot,
> but unfortunately these give you even more of a learning curve. If you tell
> us a bit about why you are doing this and what you want to get out of it you
> might get some more specific suggestions.
>
> --
> Scott McPhillips [VC++ MVP]

Re: link gui's by Scott

Scott
Fri Jul 11 13:18:31 CDT 2008

"SteveDB1" <SteveDB1@discussions.microsoft.com> wrote in message
news:5084681D-0E62-421C-8C68-392E5B0387F3@microsoft.com...
> Express Not enough.... now why does that not surprise me.
>
> As to why/what.... how much time have you got?
> Essentially, I came across a problem in my former career as a sheet metal
> mechanic, and when I returned to school, I learned math/physics, excel,
> and
> C++. I first solved the problem in excel, then once I learned C++, school
> style, I began tinkering until I found the solution, with a console appl.
>
> At a specific point I realized that this would have limited value, as I
> wanted to sell it to former coleagues, and those still in the trade with a
> use for it. So creating a "windows app" seemed the most beneficial. Using
> VS6.0 C++, and eventually J+, I began creating GUI's by drag/drop, until I
> hit the present snag/wall I face (my reason for coming here, but back in
> 2001).
>
> I eventually spoke with my C++ TA at school, and paid him to "link it all
> together" so it would work. Two weeks later he handed me a floppy disk
> with a
> MS J+ jvm program that was "windows friendly" and could work "cross
> platform."
>
> This worked great, and after posting it on a website, I began receiving
> good
> reviews. Then came the day NTFS made it passed NT into XP.
> After that it ceased working, and I was left with a useless exe file.
> Since
> I had no means at the time to update it, I let it go. No amount of
> updating
> jvm, or anything else helped.
>
> Last year a buddy of mine who does some programming told me about Java's,
> then new, NetBeans IDE, and I tried using that, with no luck because of my
> limited programming knowledge/skills.
>
> Two months ago I read about WidgetsWX using C++ to allow a Java conversion
> (for cross platform viability), so I came back to once again make a go of
> this-- for me this time, and its updating. Now that I've decided to come
> back
> and see if I could update it, I need to learn this, as I don't know of any
> more programmers whom I could hand a handfull of cash to do it for me. And
> while I could track one down, I've become sufficiently curious about
> programming, and am using VBA in Excel more now with my work, that I'd
> really
> like to learn.
>
> Sorry for the long-windedness, but that's both why and what.
> Thanks for your response.
> Best.

Interesting, and pretty cool that you have stuck with this for so long. It
is my understanding that with the express edition you can use C# to create
GUI programs, which would probably be the easiest way for you. Or, you can
use Charles Petzold's "Programming Windows, 5th edition" book to learn how
to do it in C. That would be the best education in Windows if you intend to
dig deeper as time goes on.

--
Scott McPhillips [VC++ MVP]


Re: link gui's by SteveDB1

SteveDB1
Fri Jul 11 15:56:01 CDT 2008

Petzold, eh?
What do you think about Ivor Horton's C++ book, by WROX?
I was looking at it online-- at WROX's site, and Amazon-- and it seemed
pretty good.


"Scott McPhillips [MVP]" wrote:

> "SteveDB1" <SteveDB1@discussions.microsoft.com> wrote in message
> news:5084681D-0E62-421C-8C68-392E5B0387F3@microsoft.com...
> > Express Not enough.... now why does that not surprise me.
> >
> > As to why/what.... how much time have you got?
> > Essentially, I came across a problem in my former career as a sheet metal
> > mechanic, and when I returned to school, I learned math/physics, excel,
> > and
> > C++. I first solved the problem in excel, then once I learned C++, school
> > style, I began tinkering until I found the solution, with a console appl.
> >
> > At a specific point I realized that this would have limited value, as I
> > wanted to sell it to former coleagues, and those still in the trade with a
> > use for it. So creating a "windows app" seemed the most beneficial. Using
> > VS6.0 C++, and eventually J+, I began creating GUI's by drag/drop, until I
> > hit the present snag/wall I face (my reason for coming here, but back in
> > 2001).
> >
> > I eventually spoke with my C++ TA at school, and paid him to "link it all
> > together" so it would work. Two weeks later he handed me a floppy disk
> > with a
> > MS J+ jvm program that was "windows friendly" and could work "cross
> > platform."
> >
> > This worked great, and after posting it on a website, I began receiving
> > good
> > reviews. Then came the day NTFS made it passed NT into XP.
> > After that it ceased working, and I was left with a useless exe file.
> > Since
> > I had no means at the time to update it, I let it go. No amount of
> > updating
> > jvm, or anything else helped.
> >
> > Last year a buddy of mine who does some programming told me about Java's,
> > then new, NetBeans IDE, and I tried using that, with no luck because of my
> > limited programming knowledge/skills.
> >
> > Two months ago I read about WidgetsWX using C++ to allow a Java conversion
> > (for cross platform viability), so I came back to once again make a go of
> > this-- for me this time, and its updating. Now that I've decided to come
> > back
> > and see if I could update it, I need to learn this, as I don't know of any
> > more programmers whom I could hand a handfull of cash to do it for me. And
> > while I could track one down, I've become sufficiently curious about
> > programming, and am using VBA in Excel more now with my work, that I'd
> > really
> > like to learn.
> >
> > Sorry for the long-windedness, but that's both why and what.
> > Thanks for your response.
> > Best.
>
> Interesting, and pretty cool that you have stuck with this for so long. It
> is my understanding that with the express edition you can use C# to create
> GUI programs, which would probably be the easiest way for you. Or, you can
> use Charles Petzold's "Programming Windows, 5th edition" book to learn how
> to do it in C. That would be the best education in Windows if you intend to
> dig deeper as time goes on.
>
> --
> Scott McPhillips [VC++ MVP]
>
>

Re: link gui's by SteveDB1

SteveDB1
Fri Jul 11 16:53:00 CDT 2008

Scott,
Something I have been able to do thus far is to create drag/drop GUI's with
the Studio Express 2008.
I just haven't figured out how to do anything beyond that.

It's actually reminiscent of Studio 6's C++ "Builder."

The new interface is much cleaner, and nicer to deal with, but beyond that,
it does remind me of how I did it using Studio 6, back in 2001.

Then, I've looked at Petzold's 5th edition programming book, and it's from
1998. That predates my introduction to C++ in September of 1999. It limits
the programming OS's to Win98, NT4, and NT5. And NT5, predates XP, as that's
NT5.5.
I.e., even my 7, and 9 year old C++ books are newer.... and as such would
have more up to date info.




> "Scott McPhillips [MVP]" wrote:
>
> > You may also find that working with the Express edition is not enough for
> > productive programming of a Windows app. A class library can help a lot,
> > but unfortunately these give you even more of a learning curve. If you tell
> > us a bit about why you are doing this and what you want to get out of it you
> > might get some more specific suggestions.
> >
> > --
> > Scott McPhillips [VC++ MVP]

Re: link gui's by Scott

Scott
Fri Jul 11 17:11:43 CDT 2008

"SteveDB1" <SteveDB1@discussions.microsoft.com> wrote in message
news:EC0C28E6-6ADB-40A7-93AD-0BC303617445@microsoft.com...
> Petzold, eh?
> What do you think about Ivor Horton's C++ book, by WROX?
> I was looking at it online-- at WROX's site, and Amazon-- and it seemed
> pretty good.


I have not looked at the book, but just read the Amazon descriptions. The
book requires either that you use MFC or /CLI. I like MFC, but it does not
come with the Express Edition of Visual C++ so you would have to pay. And
if you're going to use /CLI you might as well use C#, it's a quite a bit
easier way to use the same library, especially for a relative beginner.
Although the downside of /CLI is that it requires that your users have the
.NET library installed.

--
Scott McPhillips [VC++ MVP]


Re: link gui's by David

David
Fri Jul 11 22:12:47 CDT 2008

SteveDB1 wrote:
> Scott,
> Something I have been able to do thus far is to create drag/drop GUI's with
> the Studio Express 2008.
> I just haven't figured out how to do anything beyond that.
>
> It's actually reminiscent of Studio 6's C++ "Builder."
>
> The new interface is much cleaner, and nicer to deal with, but beyond that,
> it does remind me of how I did it using Studio 6, back in 2001.
>
> Then, I've looked at Petzold's 5th edition programming book, and it's from
> 1998. That predates my introduction to C++ in September of 1999. It limits
> the programming OS's to Win98, NT4, and NT5. And NT5, predates XP, as that's
> NT5.5.
> I.e., even my 7, and 9 year old C++ books are newer.... and as such would
> have more up to date info.

Steve:

If you want to program Windows with the Win32 API or MFC, the old books are
still good. The only thing that has really changed in XP and Vista is that you
are not allowed to (or at least should not) write to Program Files or the HKLM
registry (as many old programs did). And your program should have a manifest if
you want it to look nice in XP/Vista.

If you want to use VC++ Express to write Windows programs, and are using the
visual designer, then you actually need to learn a new language called C++/CLI,
which is able to target the .NET framework. But Microsoft no longer recommends
C++/CLI for writing GUI applications (just for inter-op with native C++ code).
For writing .NET GUI applications you should use C# (or VB.NET).

The Windows programming landscape has gotten quite complex, and it would pay to
do some study before jumping into anything. As always, Wikipedia is a good place
to start if you are unsure what the various terms mean.

--
David Wilkinson
Visual C++ MVP

Re: link gui's by Giovanni

Giovanni
Sat Jul 12 03:08:35 CDT 2008


"Scott McPhillips [MVP]" <org-dot-mvps-at-scottmcp> ha scritto nel messaggio
news:u0p69124IHA.784@TK2MSFTNGP04.phx.gbl...

> You may also find that working with the Express edition is not enough for
> productive programming of a Windows app. A class library can help a lot,
> but unfortunately these give you even more of a learning curve.

Scott is correct in saying that VC++ Express does not include MFC.

So, the OP might consider an open-source GUI library, like wxWidgets. I'm
not sure, but I think that VC++ Express and wxWidgets can be used together.

Giovanni



Re: link gui's by SteveDB1

SteveDB1
Sun Jul 13 12:15:01 CDT 2008

Ok.....
so it appears I go get petzold's book, look more closely at widgets, and
spend a while reading on both.
This next part laughingly stated---
strange how things we'd once believed would be so simple get complicated so
quickly once a little investigation takes place.

Is there anything else that I should be aware of?

now on a more serious note-

Guys,
Thank you for your helps. Each and everyone of them.
You've definitely given me a more succinct direction, which was what I'd
really wanted.
Best.



"Giovanni Dicanio" wrote:

>
> "Scott McPhillips [MVP]" <org-dot-mvps-at-scottmcp> ha scritto nel messaggio
> news:u0p69124IHA.784@TK2MSFTNGP04.phx.gbl...
>
> > You may also find that working with the Express edition is not enough for
> > productive programming of a Windows app. A class library can help a lot,
> > but unfortunately these give you even more of a learning curve.
>
> Scott is correct in saying that VC++ Express does not include MFC.
>
> So, the OP might consider an open-source GUI library, like wxWidgets. I'm
> not sure, but I think that VC++ Express and wxWidgets can be used together.
>
> Giovanni
>
>
>

Re: link gui's by Hendrik

Hendrik
Sun Jul 13 16:41:22 CDT 2008

SteveDB1 <SteveDB1@discussions.microsoft.com> wrote:
> [...]
> Is there anything else that I should be aware of?

Have you looked at Borland's C++ Builder? (In fact,
acutually now it's Embarcadero's, as Borland has
sold it.)
You can build a GUI by mouse clicks and have it call
your C++ code. The compiler is a bit flaky on some
advanced template stuff, but from what I read it
seems unlikely that you used that.
Also, they have a free downloadable version of it.

> [...]

Schobi

--
SpamTrap@gmx.de is never read
I'm HSchober at gmx dot de
"I guess at some point idealism meets human nature and
explodes." Daniel Orner



Re: link gui's by Giovanni

Giovanni
Sun Jul 13 18:25:04 CDT 2008


"Hendrik Schober" <SpamTrap@gmx.de> ha scritto nel messaggio
news:eP6A5ET5IHA.2544@TK2MSFTNGP04.phx.gbl...
> SteveDB1 <SteveDB1@discussions.microsoft.com> wrote:
>> [...]
>> Is there anything else that I should be aware of?
>
> Have you looked at Borland's C++ Builder? (In fact,
> acutually now it's Embarcadero's, as Borland has
> sold it.)
> You can build a GUI by mouse clicks and have it call
> your C++ code.

If the OP wants a RAD (Rapid Application Development) approach to build
GUIs, I would suggest C# and WinForm.
Then, he can call use his C++ code from the GUI event handlers, using
C++/CLI as a bridge between GUI presentation layer (C#) and "back-end"
(C++).

Visual Studio Express is a free download from Microsoft (and I believe it is
far better than Borland products).

Giovanni