Creating forms, toolbars etc using Visual C++ 6.0

P

Paul Tremblay

Hi,

I can't seem to locate the visual C++ (pre .NET) ng. This may be slight
off topic here - please point me to the correct ng if it is.

Without going into much detail (and repeating myself several times), I
am using Visual C++ 6.0 to develop applications - *instead* of .Net. I
am using the MFC to create my GUI components.

I am particularly interested in doing the ff with my GUI:

1). Achieving the XP look and feel
2). Creating floating/docakable toolbars
3). Visually designing a form (a bit like can be done using VB), so that
I can place components (e.g. images, combo boxes etc) on the form at
design time

Could anyone please point me to some samples that show me how to do
this. Please note: I already know all this can be done (and done more
easily in .Net), so please do not try to convince me to create the GUI
in dotNet - I've already explained why I don't want to go down the .Net
route in an earlier post.

I would be extremely grateful for any feedback I receive.

Many thanks

Paul
 
D

David Lowndes

I am particularly interested in doing the ff with my GUI:
1). Achieving the XP look and feel

Paul,

Have a look at "Using Windows XP Visual Styles" on MSDN:

http://msdn.microsoft.com/library/en-us/dnwxp/html/xptheming.asp
2). Creating floating/docakable toolbars
3). Visually designing a form (a bit like can be done using VB), so that
I can place components (e.g. images, combo boxes etc) on the form at
design time

You can create toolbars with VC6, and design a form (dialog) using the
IDE's dialog editor.
Could anyone please point me to some samples that show me how to do
this.

If you've not already done so, do the Scribble MFC tutorial - which
should be supplied with your VC6.
Please note: I already know all this can be done (and done more
easily in .Net), so please do not try to convince me to create the GUI
in dotNet - I've already explained why I don't want to go down the .Net
route in an earlier post.

You can still use VS2002/3/5 to produce native MFC applications as you
can with VC6. They don't have to be managed code and if you'd find it
advantageous, you get the benefit of a much more standard compliant
C++ compiler .

Dave
 
P

Paul Tremblay

David,

Thank you very much for the information and links. I may have one or
more additional questions after I have had a chance to read the
documentation - I hope you don't mind.

Many thanks once again.

Paul
 
P

Paul Tremblay

David Lowndes wrote:

You can still use VS2002/3/5 to produce native MFC applications as you
can with VC6. They don't have to be managed code and if you'd find it
advantageous, you get the benefit of a much more standard compliant
C++ compiler .
</snip>

Hi Dave,

This is most interesting from me - do you have a link that shows how
Windows Forms can be designed in VS2003 (I've downloaded express
version) and then generate a *natrive* application from the Windows
Forms - I take it that I will not have to use PInvoke or C++/InterOp to
call functions/methods in my existing C++ libraries (this is actually
the ultimate solution - ease of GUI design, ANSI compliant compiler and
native binary compilation - with no MSIL code or PE anywhere).

Look forward to your reply - mtia
 
D

David Lowndes

This is most interesting from me - do you have a link that shows how
Windows Forms can be designed in VS2003 (I've downloaded express
version) and then generate a *natrive* application from the Windows
Forms

I didn't say Windows Forms. WinForms are managed code only AFAIK.

I've not tried them myself, but I believe the express product only
comes with facilities to develop managed applications.

Dave
 
P

Paul Tremblay

Hi Dave,

Thanks for the prompt response. Do you know how forms (Frames) can be
developped using VS2003 ?. Does it have a "proper" forms designer (ala
VB) in VS2003? - or does one have to create forms via Dialog boxes as
your last message seemed to suggest?

Lastly, is it possible to create toolboxes like the control toolbox that
VC (or even VB) displays ? - once again any links to such sample apps
would be very welcome.

mtia - Paul
 
C

Carl Daniel [VC++ MVP]

Paul said:
Hi Dave,

Thanks for the prompt response. Do you know how forms (Frames) can be
developped using VS2003 ?. Does it have a "proper" forms designer (ala
VB) in VS2003? - or does one have to create forms via Dialog boxes as
your last message seemed to suggest?

Lastly, is it possible to create toolboxes like the control toolbox
that VC (or even VB) displays ? - once again any links to such sample
apps would be very welcome.

mtia - Paul

"Forms" is a vague term.

WinForms is a pure managed technology, targeted by VC++ 2003 and later (or
C#/VB 2002 and later).

You can also build a "forms" application by building conventional windows
dialogs, using the MFC/Win32 dialog editor and built-in or custom controls.
You can still do that in VC++ 2003 and 2005. You cannot, however, do that
using VC++ 2005 Express, which is apparently what you've got (aside from
VC6).

There are MFC examples and controls for just about all of what you're asking
for. I'd suggest starting with a general overview (and the Scribble
tutorial, as David mentioned). See

http://msdn.microsoft.com/library/d..._Overview.3a_.Creating_an_MFC_EXE_Program.asp

for a good "jumping off" point for MFC development topics.

-cd
 
C

Carl Daniel [VC++ MVP]

Paul said:
Hi,

I can't seem to locate the visual C++ (pre .NET) ng. This may be
slight off topic here - please point me to the correct ng if it is.

This one's fine. You might also try:

microsoft.public.vc.language
microsoft.public.vc.mfc

All of these newsgroups can be accessed via NNTP through news.microsoft.com,
or via web browser through http://msdn.microsoft.com/newsgroups/.

-cd
 
P

Paul Tremblay

You can also build a "forms" application by building conventional windows
dialogs, using the MFC/Win32 dialog editor and built-in or custom controls.
You can still do that in VC++ 2003 and 2005. You cannot, however, do that
using VC++ 2005 Express, which is apparently what you've got (aside from
VC6).
</snip>

Hi Carl,

Many thanks for that - I think the approach to take is beginning to
become clearer to me: It seems I can use either VC++ 6.0 or VS 2003 (I
have access to the Archiect edition at work) to build MFC applications.
However, I believe (I stand to be corrected), in VC++, "forms" (to
borrow from VB terminology) are built using the dialog editor (is that
correct)?

Last but not the least, I would be grateful for answers to these questions:

Q1). Can I use MFC in VS 2003 (using the Dialog Editor - rather
misleading name that) to create a UI - and then build a native binary
from the designed user interfaces (i.e. for the entire application) ?

Q2). I don't need to use PInvoke or C++/InterOp in my application - I
can #include the headers, link to the libs and build a native binary of
my app (even though I am using BS 2003)?

Q3). Do I get the XP look and feel "for free" when I use the Design
Editor in VS 2003 to create my user interfaces (Window Frames) ? or do I
have to resort to "work arounds" kindly provided by David in his earlier
post?

I look forward to your response.

mtia - Paul
 
C

Carl Daniel [VC++ MVP]

Paul said:
</snip>

Hi Carl,

Many thanks for that - I think the approach to take is beginning to
become clearer to me: It seems I can use either VC++ 6.0 or VS 2003 (I
have access to the Archiect edition at work) to build MFC
applications. However, I believe (I stand to be corrected), in VC++,
"forms" (to borrow from VB terminology) are built using the dialog editor
(is that
correct)?
Correct.

Last but not the least, I would be grateful for answers to these
questions:
Q1). Can I use MFC in VS 2003 (using the Dialog Editor - rather
misleading name that) to create a UI - and then build a native binary
from the designed user interfaces (i.e. for the entire application) ?

100% native, yes. You can also build your own custom window classes if your
app isn't really "form-based" (e.g. Word, Excel, etc). MFC has an extensive
"document view" (a bastardization of MVC) architecture for building
applications that are basically document editors (like Word).
Q2). I don't need to use PInvoke or C++/InterOp in my application - I
can #include the headers, link to the libs and build a native binary
of my app (even though I am using BS 2003)?

Absolutely. Still true with VC++ 2005 as well (and will always be true).
Q3). Do I get the XP look and feel "for free" when I use the Design
Editor in VS 2003 to create my user interfaces (Window Frames) ? or
do I have to resort to "work arounds" kindly provided by David in his
earlier post?

You don't get the XP look and feel for free unless you use winforms, which
handles all the XP-theme stuff for you behind the scenes.

-cd
 
P

Paul Tremblay

Thank you very much Carl. I have all the information I need to make a
decision now.

many thanks for your help
 
D

David Lowndes

Q3). Do I get the XP look and feel "for free" when I use the Design
Editor in VS 2003 to create my user interfaces (Window Frames) ? or do I
have to resort to "work arounds" kindly provided by David in his earlier
post?

Paul,

They're not work-arounds - it's the way it is!

To get the XP themed look you have to have your application use the V6
common controls - which you do by using a manifest (as shown in that
MSDN article I referenced).

Dave
 

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