473,408 Members | 2,027 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,408 software developers and data experts.

Where Is the Message Loop?

Using Visual C++8.0 Express Edition I created a "Solution " using a "Form"
(dialog) of my own design.

Without adding any code of my own I compiled the code generated for me by
Visual C++. The compiled .exe produced the expected dialog with all the
function I expected (tabbing, text entry etc.).

At that point I ran headlong into a huge stone wall -- try as I may I could
not find the message loop in the generated code so that I could add
functionality to the dialog.

I am certain that there is a message loop there (somewhere) because without
a the minimal function of the dialog box could not be achieved.

Will some kind soul please tell me how to locate the place in the generated
code (or elsewhere) where I can add the application functionality.

Thanks,
Jul 29 '08 #1
9 1644
>Using Visual C++8.0 Express Edition I created a "Solution " using a "Form"
>(dialog) of my own design.
What type of project did you create? .Net, MFC, SDK (presumably not
the latter from what you say)?

If it's either of the former 2 types of project the message loop is
hidden (deeply in the case of .Net).
>At that point I ran headlong into a huge stone wall -- try as I may I could
not find the message loop in the generated code so that I could add
functionality to the dialog.
You rarely need to access the message loop directly, the .Net or MFC
frameworks hide you from that detail.
>I am certain that there is a message loop there (somewhere) because without
a the minimal function of the dialog box could not be achieved.
If you really want to have a old fashioned message loop, create a
Win32 (SDK) project.

Dave
Jul 29 '08 #2
David Lowndes wrote:
>Using Visual C++8.0 Express Edition I created a "Solution " using a
"Form" (dialog) of my own design.

What type of project did you create? .Net, MFC, SDK (presumably not
the latter from what you say)?

If it's either of the former 2 types of project the message loop is
hidden (deeply in the case of .Net).
>At that point I ran headlong into a huge stone wall -- try as I may
I could not find the message loop in the generated code so that I
could add functionality to the dialog.

You rarely need to access the message loop directly, the .Net or MFC
frameworks hide you from that detail.
>I am certain that there is a message loop there (somewhere) because
without a the minimal function of the dialog box could not be
achieved.

If you really want to have a old fashioned message loop, create a
Win32 (SDK) project.
Or simply, in the forms editor, switch the properties editor over to the
"events" tab and handle Click / BN_CLICKED events or some such.
>
Dave

Jul 29 '08 #3
Dave, thanks for the response.

I am not sure what type of application was generated but I used the "New
-Project" dialog from which I selected "Windows Form Application" to do it.
I, like you, am quite certain that it is not an SDK application.

When I last programmed, 12 years ago when I became visually impaired, it was
at the SDK level -- a level which is now entirely too tedious for me.

I love programming and think that the Visual Studio paradigm will allow me
to do it again. I would, therefore, really appreciate either a discussion of
where and how to add the application functionality in the new (to me) way or
a pointer (URL) to such a discussion. At this point it is just too difficult
for me to revert to the SDK.

Thanks again,
"David Lowndes" wrote:
Using Visual C++8.0 Express Edition I created a "Solution " using a "Form"
(dialog) of my own design.

What type of project did you create? .Net, MFC, SDK (presumably not
the latter from what you say)?

If it's either of the former 2 types of project the message loop is
hidden (deeply in the case of .Net).
At that point I ran headlong into a huge stone wall -- try as I may I could
not find the message loop in the generated code so that I could add
functionality to the dialog.

You rarely need to access the message loop directly, the .Net or MFC
frameworks hide you from that detail.
I am certain that there is a message loop there (somewhere) because without
a the minimal function of the dialog box could not be achieved.

If you really want to have a old fashioned message loop, create a
Win32 (SDK) project.

Dave
Jul 29 '08 #4
Ben, .

As you may surmise from my response to Dave I have not seen the tab that
you mentioned. It sounds like the answer to maidens prayer if only I could
find it.

I would expect that it exists separately for each control and would,
therefore, think that each control for which I want to specify an action need
be selected at the time this tab appears. After that, the location of the
tab is a total mystery -- I just can't find it.

If you would be so kind, please give me specific instructions to find that
tab.

I am waiting breathlessly for your response!

Thank you so much for the help,
>"Ben Voigt [C++ MVP]" wrote:
>Or simply, in the forms editor, switch the properties editor over to the
"events" tab and handle Click / BN_CLICKED events or some such.

Jul 29 '08 #5
>I am not sure what type of application was generated but I used the "New
>-Project" dialog from which I selected "Windows Form Application" to do it.
I, like you, am quite certain that it is not an SDK application.
That'll be a CLR (.Net) application then.

You'll have been presented with an empty form that you can then
drag/drop controls from the Toolbox.

Let's say you put a push button on the form. Select the button on the
form and (if it's not already displayed), choose View, Properties
Window.

In the property window pane, click the lightning bolt (Events) button.
You can now add handlers for things like the Click event. Double click
the handler to go to the code view.

Dave
Jul 29 '08 #6
Steve Behman wrote:
Dave, thanks for the response.

I am not sure what type of application was generated but I used the
"New
-Project" dialog from which I selected "Windows Form Application"
to do it. I, like you, am quite certain that it is not an SDK
application.

When I last programmed, 12 years ago when I became visually impaired,
it was at the SDK level -- a level which is now entirely too tedious
for me.

I love programming and think that the Visual Studio paradigm will
allow me to do it again. I would, therefore, really appreciate
either a discussion of where and how to add the application
functionality in the new (to me) way or a pointer (URL) to such a
discussion. At this point it is just too difficult for me to revert
to the SDK.
As Dave correctly replied, you've created a Winforms application. If you
want to do Winforms, I'd strngly recommend that you switch to C# - it can be
done in C++, but it's needlessly tedious, and the designers interact better
with C#.

If you're going to continue on with Windows Forms using managed C++, you
might want to get this book:

http://www.amazon.com/CLI-Action-Man.../dp/1932394818

Regardless of the language you use, if you're going to continue with Windows
Forms, you might want to get this book:

http://www.amazon.com/Windows-Forms-.../dp/0321267966

For just "goofing around", it's hard to beat the simplicity of winforms with
C#. For more serious GUI development, you might want to consider using MFC
(which unfortunately means that you cannot use VC++ Express, which does not
include MFC).

-cd
Jul 30 '08 #7
Carl, I appreciate your suggestion. I have been programming for 55 years in
about as many languages as years, I'm afraid that one more language would be
the straw that breaks this old camel's back.

If it was not for programs called ZoomText and Dragon NaturallySpeaking I
couldn't read or write anything at all -- but they do not work with paper.

Most of my own C++ programming was for OS/2 for which I developed the
equivalent of the MFC (with an interface to DB/2 using the IBM equivalent of
the SDK.

As a consequence of the above I will do piecewise development of my
application with the Visual Studio tool and then port them to the MFC for
integration into a whole application (that is if I live that long :-).

Thanks again to all of you, I appreciated the help.

"Carl Daniel [VC++ MVP]" wrote:
Steve Behman wrote:
Dave, thanks for the response.

I am not sure what type of application was generated but I used the
"New
-Project" dialog from which I selected "Windows Form Application"
to do it. I, like you, am quite certain that it is not an SDK
application.

When I last programmed, 12 years ago when I became visually impaired,
it was at the SDK level -- a level which is now entirely too tedious
for me.

I love programming and think that the Visual Studio paradigm will
allow me to do it again. I would, therefore, really appreciate
either a discussion of where and how to add the application
functionality in the new (to me) way or a pointer (URL) to such a
discussion. At this point it is just too difficult for me to revert
to the SDK.

As Dave correctly replied, you've created a Winforms application. If you
want to do Winforms, I'd strngly recommend that you switch to C# - it can be
done in C++, but it's needlessly tedious, and the designers interact better
with C#.

If you're going to continue on with Windows Forms using managed C++, you
might want to get this book:

http://www.amazon.com/CLI-Action-Man.../dp/1932394818

Regardless of the language you use, if you're going to continue with Windows
Forms, you might want to get this book:

http://www.amazon.com/Windows-Forms-.../dp/0321267966

For just "goofing around", it's hard to beat the simplicity of winforms with
C#. For more serious GUI development, you might want to consider using MFC
(which unfortunately means that you cannot use VC++ Express, which does not
include MFC).

-cd
Jul 30 '08 #8
Hi Steve,
Carl, I appreciate your suggestion. I have been programming for 55
years in about as many languages as years, I'm afraid that one more
language would be the straw that breaks this old camel's back.
When you stay with Windows Forms projects in VC++ then nevertheless
you will need to learn a new flavour of C++ called C++/CLI. It has several
C++ extensions needed for programming in the .Net world.
So I would still recommend to stick with C# when it comes to pure
..Net programming. C++/CLI is of most use when you want to use your
legacy code base in .Net applications or when you want to wrap your
legacy API as a .Net class library.
Most of my own C++ programming was for OS/2 for which I developed the
equivalent of the MFC (with an interface to DB/2 using the IBM
equivalent of the SDK.

As a consequence of the above I will do piecewise development of my
application with the Visual Studio tool and then port them to the MFC
for integration into a whole application
If you are going the MFC way then you are in well known C++ land where
using C++ makes much more sense than in .Net world. But up to now the
VC++ Express edition does neither include MFC nor ATL. So you would
have to use at least VC++ Standard Edition

--
SvenC
Jul 30 '08 #9
Steve Behman wrote:
Ben, .

As you may surmise from my response to Dave I have not seen the tab
that
you mentioned. It sounds like the answer to maidens prayer if only I
could find it.

I would expect that it exists separately for each control and would,
therefore, think that each control for which I want to specify an
action need be selected at the time this tab appears. After that,
the location of the tab is a total mystery -- I just can't find it.
We're discussing the properties window (View menu, Properties window,
default hotkey F4). I suspect you've already used that, because it's where
you set the captions of your buttons and so on.

At the top of the properties window is a small toolbar. The second area of
the toolbar has two icons, one a grid which is probably highlighted, the
second is a lightning bolt. Click the lightning bolt to get the list of
events. At this point you can double-click any entry to let Visual Studio
use the default function name to handle it, or type in your own preferred
name. At this point you're likely to be in the code window.
>
If you would be so kind, please give me specific instructions to find
that tab.

I am waiting breathlessly for your response!

Thank you so much for the help,
>"Ben Voigt [C++ MVP]" wrote:
>Or simply, in the forms editor, switch the properties editor over to
the "events" tab and handle Click / BN_CLICKED events or some such.

Jul 30 '08 #10

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

Similar topics

6
by: S. David Rose | last post by:
Hello All! I am new to Python, and wanted to know if I might ask you a question regarding timing. I want a main loop which takes photos from 8 different web-cams, each can be addressed by...
20
by: David | last post by:
Hi, I have a field from my recordset called RS("Password"). If I wish to display each character as an asterix '*' how do I go about it. I've seen the replace function, but cannot work out how...
8
by: GUEST | last post by:
Hi all. I'm a newbie to ORacle and am planning to take a course in Oracle this January. Can anyone tell me where a SQL/PL script is run from ? I tried to run a simple SQL/PL script under SQL...
2
by: MLH | last post by:
Take a look at the code that follows. Line 110 is the beginning of Do-Loop. Regarding line #220, I find that I'm getting Error #3021 (No Current Record) during execution of line #230. It puzzles me...
7
by: Muscha | last post by:
My c# application has gone beserk, it consumes 700MB memory griding my machine to a halt. What is the quickest way for me to find out what's happening? Where do all the memory has gone? /m
20
by: Frank-O | last post by:
Hi , Recently I have been commited to the task of "translating" some complex statistical algorithms from Matlab to C++. The goal is to be three times as fast as matlab ( the latest) . I've...
9
by: Emin | last post by:
Dear Experts, I have a fairly simple query in which adding a where clause slows things down by at least a factor of 100. The following is the slow version of the query ...
8
by: chrisdavis | last post by:
I'm trying to filter by query or put those values in a distinct query in a where clause in some sort of list that it goes through but NOT at the same time. Example: ROW1 ROW2 ROW3 ROW4 ,...
4
by: Jeff | last post by:
Hi all, For some reason, this seems to fail for me (it's psuedo-code): for(var i=0; i<length; i++) { for(var j=0; j<length; j++) { ... if(condition) { break my_label; }
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.