473,395 Members | 1,577 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

VC++ Windows forms beginner question

managed C++
VS 2003

I have a beginner question about windows forms....
I need to call a function when a certain limit has been reached, now with
the way VS sets up the .NET windows Form I get confused. When I was using
Directx everything was being run from a while loop, so that was no problem
for me in seeing where to place conditional statements and other functions.

With windows forms do I need to have an event and eventhandler? it just
confuses me because of the form.h and form.cpp and pretty much all there is
in the .cpp is Application::Run(....).

Also can you give me advice on any good books for C++ .Net and WIndows. I
have Mircosoft Visual C++ .NET (step by step) by Templeman and Olsen but they
really don't give that much info on Windows forms and such.
--
Neal
Jan 26 '06 #1
3 2617
"Neal" <Ne**@discussions.microsoft.com> wrote in message
news:12**********************************@microsof t.com...
managed C++
VS 2003

I have a beginner question about windows forms....
I need to call a function when a certain limit has been reached, now with
the way VS sets up the .NET windows Form I get confused. When I was using
Directx everything was being run from a while loop, so that was no problem
for me in seeing where to place conditional statements and other
functions.

With windows forms do I need to have an event and eventhandler? it just
confuses me because of the form.h and form.cpp and pretty much all there
is
in the .cpp is Application::Run(....).

Also can you give me advice on any good books for C++ .Net and WIndows. I
have Mircosoft Visual C++ .NET (step by step) by Templeman and Olsen but
they
really don't give that much info on Windows forms and such.


"Windows Forms Programming in C#" by Chris Sells is a good book. You'll
have to translate from C# to C++, but that's not too hard.

Generally, just about everything that you write in a forms application is
(directly or indirectly) invoked as part of an event handler.

When you say "when a certain limit has been reached", what kind of a limit
are you talking about? Time? Mouse clicks? Value entered into a text
box? If it's time that you're interested in, look at the
Sytem.Windows.Forms.Timer class - drop a timer on your form, set it's period
to the time delay you want, and handle the Tick event.

-cd
Jan 26 '06 #2
Thanks for the book suggestions.
And yes I meant to say time limit, I will check into the Timer Class. Thank
You.
--
Neal
"Carl Daniel [VC++ MVP]" wrote:
"Neal" <Ne**@discussions.microsoft.com> wrote in message
news:12**********************************@microsof t.com...
managed C++
VS 2003

I have a beginner question about windows forms....
I need to call a function when a certain limit has been reached, now with
the way VS sets up the .NET windows Form I get confused. When I was using
Directx everything was being run from a while loop, so that was no problem
for me in seeing where to place conditional statements and other
functions.

With windows forms do I need to have an event and eventhandler? it just
confuses me because of the form.h and form.cpp and pretty much all there
is
in the .cpp is Application::Run(....).

Also can you give me advice on any good books for C++ .Net and WIndows. I
have Mircosoft Visual C++ .NET (step by step) by Templeman and Olsen but
they
really don't give that much info on Windows forms and such.


"Windows Forms Programming in C#" by Chris Sells is a good book. You'll
have to translate from C# to C++, but that's not too hard.

Generally, just about everything that you write in a forms application is
(directly or indirectly) invoked as part of an event handler.

When you say "when a certain limit has been reached", what kind of a limit
are you talking about? Time? Mouse clicks? Value entered into a text
box? If it's time that you're interested in, look at the
Sytem.Windows.Forms.Timer class - drop a timer on your form, set it's period
to the time delay you want, and handle the Tick event.

-cd

Jan 26 '06 #3
First to clarify, even in .Net Windows Forms everything runs in a while
loop. When you say Application::Run(...), it actually starts a while
loop, waiting for messages on the process main thread which can be
handled by adding a message filter :-
Application::AddMessageFilter(...)
which must be done before Application::Run(...) as this 'Run' method
starts an infinite while loop.
Now, this part was common between your directx application and the
windows forms application. Now you have another thing, there is another
filter working in background, all the windows message is forwarded to
the form's onWindowProc method, which can be overridden.

Even the timer's WM_TIMER event goes thru all this :)

Remember, Timer you can not rely upon ... as if you have other window
message handler running for a longer time, timer event will not come on
time.

Tell us what you need to do exactly and I hope we can help you with that...

--
Abhijeet Dev
Neal wrote:
managed C++
VS 2003

I have a beginner question about windows forms....
I need to call a function when a certain limit has been reached, now with
the way VS sets up the .NET windows Form I get confused. When I was using
Directx everything was being run from a while loop, so that was no problem
for me in seeing where to place conditional statements and other functions.

With windows forms do I need to have an event and eventhandler? it just
confuses me because of the form.h and form.cpp and pretty much all there is
in the .cpp is Application::Run(....).

Also can you give me advice on any good books for C++ .Net and WIndows. I
have Mircosoft Visual C++ .NET (step by step) by Templeman and Olsen but they
really don't give that much info on Windows forms and such.

Jan 26 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Steven O. | last post by:
First, sorry if by some chance I am not posting to the correct newsgroups, these seemed to be the most applicable to my question (see disclaimer at end of post for further comments....). Started...
3
by: Shardul Kulkarni | last post by:
Hello everyone, I am Shardul Kulkarni,and I am doing M.Sc.(Computer Science) from PUNE University (INDIA). I have one subject : Windows Programing using VC++(SDK). So, can anyone refer me some...
1
by: Jiang Yue Brandon | last post by:
I am very confused about the different ways of VC++ and C# for doing windows form/dialog design in Visual Studio.NET. In C#, after you drag & drop the components to the form, the underlying...
9
by: borhan | last post by:
Hi folks, I am using vs.net 2003 for a time, however since last week I was using MFC. Now, I am into managed C++ and windows forms. I can say that I am very much confused with it, and I have...
20
by: Peter E. Granger | last post by:
I'm having a strange problem (or at least it seems strange to me) trying to display a MessageBox in a VC++ .NET forms application. If I put the call to MessageBox::Show in the form's .h file, it...
3
by: Scott | last post by:
I've googled this a bit and suppose I know the answer, but I'd appreciate any input: I'd like to write windows forms apps in C++, but it seems almost as if that is discouraged. As an example,...
8
by: The unProfessional | last post by:
To the VC .Net'ers out there... I noticed alot of strange behavior in the way VC .Net apps behave in the IDE. It's a bit odd, so maybe people have workarounds. I'm worried to devote my project...
1
by: foreman | last post by:
Hello Everybody: I am trying out DialogBox, and I have been trying to press the OK Button on the dialogbox hoping I can receive the OK DialogResult to Main Form. Below is my OK button click...
11
by: Dr. Zharkov | last post by:
We want to export myArrayVB (2000, 2) of VB .NET 2003 in myArrayVó of VC++ .NET 2003 on scheme "component - client". But there is an error. For development of a component in VB .NET 2003 we...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.