Noob question regarding c# and classic windows apps

  • Thread starter Thread starter Tom Porterfield
  • Start date Start date
T

Tom Porterfield

Bf said:
I was creating test projects using c# and was surprised that there
seems to be only a form based windows applications available. Is it
safe to assume that classic window applications that utilize a parent
window with child windows can only be done in c++ and mfc and there's
nothing else in .net that is meant to be used like that?

It seems to be that c# should be used for either form based windows
apps, console apps, and web apps (also controls, services and directx
apps).

I need to create a classic windows type app, is there a way to use
some of the .net ado functions from this app?

You can do MDI parent/child apps in C#. Set your container with the
IsMdiContainer property as true. On your children set the MdiParent
property to your container.

--
Tom Porterfield
MS-MVP MCE
http://support.telop.org

Please post all follow-ups to the newsgroup only.
 
...
Is it safe to assume that classic window applications that
utilize a parent window with child windows can only be done
in c++ and mfc and there's nothing else in .net
that is meant to be used like that?

No.

Just create a Windows Application and change the property IsMDIContainer on
the form to true.

// Bjorn A
 
Bf said:
I was creating test projects using c# and was surprised that there seems to
be only a form based windows applications available. Is it safe to assume
that classic window applications that utilize a parent window with child
windows can only be done in c++ and mfc and there's nothing else in .net
that is meant to be used like that?

It seems to be that c# should be used for either form based windows apps,
console apps, and web apps (also controls, services and directx apps).

I need to create a classic windows type app, is there a way to use some of
the .net ado functions from this app?

Thanks alot.
If by "classic Windows", you mean the API and MFC, forget it (with C#).
C# is a .NET language and, therefore, uses the .NET Framework classes, not
MFC.
You can use legacy components in your .NET applications.
Others here have already told you how to get MDI behavior in .NET.
If you want to use C#, you'll be ding things the .NET Framework way, and
ADO.NET will be your "default" database access technology.
 
Bf said:

"Form" is just the .net term for "top-level-window", or "frame window".
...
Well I was looking for the classic explorer tree on the left side and child
windows on the right type of look. Years ago I used this third party
framework to create child windows controlled by tabs kind of the way visual
studio .net looks now. Is that supported in C#?

Of course you can put splitters into your forms, but the vstudio-look isn't
part of the .net framework. There are however lots of UI-frameworks for .net
available - google.
Some of the child windows might host an older ocx control for charting and I
was hoping to convert some older c++ routines (which are multithreaded) for
log messages.

Using OCXs in .net is quite easy - the designer will do all the work; For
your C++ routines, you could compile them with MC++, or access them through
a DLL or COM interface.
But the .net threading support is (imo) far better than native Win32
threading API, or MFC's CWinThread-wrappers - consider rewriting some of
your old code.
Does this sounds feasible in c# or a boat load of work most of which hasn't
really been done yet?

Many people (including myself) have done this before: definitely feasible.
I don't suppose this would be a good fit for a managed c++ app would it?

You might want to compile your old c++ code with MC++, or build interface
layers with it (see above) so you can conveniently include old code it into
your .net app, but I'd use C# for the "shiny new .net parts".
But I guess that's a matter of taste.

Niki
 
Hi Bf,

IMHO if you look more closer programming with windows forms is not that
different. You have child windows called controls and you have top-level
windows called forms. all controls are releated in parent/children
relationship. The only difference is how do you create the application
window and handle child notifications. If you are use to MFC even the
notification is not that different. Instead of hooking them via ON_XXX
macros you hook events.

Don't forget that different frameworks intruduce different ways to create
your application. All frameworks have a learning curve, but finally you
should be able to write all kind of applications

..NET doesn't restrict you to use Windows Forms only. But this is the
framework for writing GUI that is shipped with .NET SDK. As long as it
serves its purpuse of building GUI applications very well the comapnies
concentrate on building frameworks only for menus toolbars, docking
components, different types of more advanced controls and other gadgets. I
don't know if Borland has its own windows framework for Delphi, but I doubt
it.
Well I was looking for the classic explorer tree on the left side and child
windows on the right type of look. Years ago I used this third party
framework to create child windows controlled by tabs kind of the way visual
studio .net looks now. Is that supported in C#?

You can surely build that kind of application and I bet it will be easier
than using MFC. However as I said there is a learning curve. You can't
expect that the propgramming discipline you use in writing MFC apps will be
the same with WindowsForms. There is one more thing .NET is a new platform
even though it runs in WindowsOS environment and some parts are build over
the existing ones. That's why not everything that works with Windows OS will
work in .NET. I'm telling you that because I see you want to use ActiveX
controls. ActiveX controls will work in most of the cases but there some
details that might not work. If you look on the net you can find a lot of ar
ticles what works and what doesn't and workarounds for most of the probelms
you may have.

I would recomend as well Adam Nathan's book
".NET and COM: The Complete Interoperability Guide" if you want to dig into
details.
 
I was creating test projects using c# and was surprised that there seems to
be only a form based windows applications available. Is it safe to assume
that classic window applications that utilize a parent window with child
windows can only be done in c++ and mfc and there's nothing else in .net
that is meant to be used like that?

It seems to be that c# should be used for either form based windows apps,
console apps, and web apps (also controls, services and directx apps).

I need to create a classic windows type app, is there a way to use some of
the .net ado functions from this app?

Thanks alot.
 
Stoitcho Goutsev (100) said:
components, different types of more advanced controls and other gadgets. I
don't know if Borland has its own windows framework for Delphi, but I doubt
it.

It does in fact. Called VCL.NET. Winforms is also an option.

Tim
Tech writing
http://www.itwriting.com
 
It does in fact. Called VCL.NET. Winforms is also an option.

Good for Borland. Frankly I don't know what new they can introduce beside
new controls since VCL and Windows Forms are not so different
 
Peter van der Goes said:
If by "classic Windows", you mean the API and MFC, forget it (with C#).
C# is a .NET language and, therefore, uses the .NET Framework classes, not
MFC.
You can use legacy components in your .NET applications.
Others here have already told you how to get MDI behavior in .NET.
If you want to use C#, you'll be ding things the .NET Framework way, and
ADO.NET will be your "default" database access technology.

Thanks for answering, I appreciate your time.

Well I was looking for the classic explorer tree on the left side and child
windows on the right type of look. Years ago I used this third party
framework to create child windows controlled by tabs kind of the way visual
studio .net looks now. Is that supported in C#?

Some of the child windows might host an older ocx control for charting and I
was hoping to convert some older c++ routines (which are multithreaded) for
log messages.

Does this sounds feasible in c# or a boat load of work most of which hasn't
really been done yet?

I don't suppose this would be a good fit for a managed c++ app would it?
 

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

Back
Top