Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

User Data and Dialog Boxes: Help Needed

0 views
Skip to first unread message

Mitchel Soltys

unread,
Jun 16, 1997, 3:00:00 AM6/16/97
to

I'm fairly new to windows programming, so this is hopefully a simple
question.

What's a good way to pass information to a DialogBox().

For example I've got a general dialog box that I want to use for selecting
items
from a list. I have several lists that the user might choose from. What
I'd like to do is pass in a title for the dialog box and a pointer to the
list of strings to choose from when the dialog box is created, but the
DialogBox function doesn't appear to have any type of parameter to support
user data. (I've heard that win95 has another version of DialogBox, but I'm
interested in an app for win 3.1 (16 bit)).

The only way I know to get around it is through using global variables,
yuuck. Any help would be much appreciated. Thanks.

Mitchel Soltys


Chris Marriott

unread,
Jun 16, 1997, 3:00:00 AM6/16/97
to

In article <01bc6867$d59715e0$32ee...@msoltys.imagicgames.com>, Mitchel
Soltys <mso...@imagicgames.com> writes

>What
>I'd like to do is pass in a title for the dialog box and a pointer to the
>list of strings to choose from when the dialog box is created, but the
>DialogBox function doesn't appear to have any type of parameter to support
>user data.

"DialogBox" doesn't, but "DialogBoxParam" does!

Chris

----------------------------------------------------------------
Chris Marriott, Microsoft Certified Solution Developer.
SkyMap Software, U.K. e-mail: ch...@skymap.com
Visit our web site at http://www.skymap.com

Uwe Post

unread,
Jun 20, 1997, 3:00:00 AM6/20/97
to

Mitchel Soltys wrote:
>
> I'm fairly new to windows programming, so this is hopefully a simple
> question.
>
> What's a good way to pass information to a DialogBox().
>
> For example I've got a general dialog box that I want to use for selecting
> items
> from a list. I have several lists that the user might choose from. What

> I'd like to do is pass in a title for the dialog box and a pointer to the
> list of strings to choose from when the dialog box is created, but the
> DialogBox function doesn't appear to have any type of parameter to support
> user data. (I've heard that win95 has another version of DialogBox, but I'm
> interested in an app for win 3.1 (16 bit)).

In case of mfc programming under vc++, you have an own from CDialog
derived class with some member variables in it. You would bring the box
to the screen via:

CMyDialog d;
d.my_member_variables = ...
d.DoModal();

where the automated DDX-functions would do the rest for you, if you
choose to connect the controls in the box to the member variables using
Class Wizard.


bye

Uwe


--
--------------------------
Dipl.-Phys. Uwe Post
Redaktion c't
u...@ct.heise.de
--------------------------

0 new messages