Hello, basic question regarding checkboxes



 DEVELOP > c-Plus-Plus > Hello, basic question regarding checkboxes

LINK TO THIS PAGE  


rating :  0   |  0


  Page 1 of 1

1

 
Topic: DEVELOP > c-Plus-Plus
User: ""
Date: 14 Jan 2008 11:48:16 AM
Object: Hello, basic question regarding checkboxes
Hello.
I want to check a checkbox using the CheckDlgButton
(hWND,IDC_CHECK1,BE_CHECKED) command
The checkbox resides in a Dialog box called IDD_MYAPPLICATION_DIALOG.
However, when I put this in the hWND field I get the error
error C2664: 'CheckDlgButton' : cannot convert parameter 1 from 'int'
to 'HWND'
Conversion from integral type to pointer type requires
reinterpret_cast, C-style cast or function-style cast
What do I have to put in the hWND field to make this work?
Cheers
.

User: "Victor Bazarov"

Title: Re: Hello, basic question regarding checkboxes 14 Jan 2008 12:21:12 PM
wrote:

I want to check a checkbox using the CheckDlgButton
(hWND,IDC_CHECK1,BE_CHECKED) command

It's not a command. It's a function call.

The checkbox resides in a Dialog box called IDD_MYAPPLICATION_DIALOG.
However, when I put this in the hWND field I get the error

error C2664: 'CheckDlgButton' : cannot convert parameter 1 from 'int'
to 'HWND'
Conversion from integral type to pointer type requires
reinterpret_cast, C-style cast or function-style cast

Compiler is correct. You cannot pass integers where 'HWND' (whatever
that is) should be. C++ is a strongly typed language.

What do I have to put in the hWND field to make this work?

You need to find the HWND (IIRC it's the window "handle") of your
checkbox. Sorry, that's the extend of my ability to help you. This
is a C++ _language_ newsgroup, not Windows GUI programming newsgroup.
Please post your Windows GUI question to a Windows GUI forum.
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
.

User: "Ron AF Greve ron@localhost"

Title: Re: Hello, basic question regarding checkboxes 14 Jan 2008 12:47:14 PM
Hi,
If you use MFC it is the m_hWnd member of CDialog.
Or if you use CreateDialog it is the return value.
Regards, Ron AF Greve
http://www.InformationSuperHighway.eu
<stewb85@gmail.com> wrote in message
news:e898ab3b-343c-4314-ab24-80a09faee94c@k2g2000hse.googlegroups.com...

Hello.

I want to check a checkbox using the CheckDlgButton
(hWND,IDC_CHECK1,BE_CHECKED) command


The checkbox resides in a Dialog box called IDD_MYAPPLICATION_DIALOG.
However, when I put this in the hWND field I get the error

error C2664: 'CheckDlgButton' : cannot convert parameter 1 from 'int'
to 'HWND'
Conversion from integral type to pointer type requires
reinterpret_cast, C-style cast or function-style cast



What do I have to put in the hWND field to make this work?

Cheers

.
User: "Christopher"

Title: Re: Hello, basic question regarding checkboxes 14 Jan 2008 02:19:21 PM
On Jan 14, 12:47 pm, "Ron AF Greve" <ron@localhost> wrote:

Hi,

If you use MFC it is the m_hWnd member of CDialog.
Or if you use CreateDialog it is the return value.

Regards, Ron AF Greve

Ron,
Your continued willingness to answer Windows specific questions does
nothing but encourage off topic postings. Why do you continue to do
so? Everytime you do it, you let an OT poster think they can keep
posting Windows specific questions here and receive help, which
clutters the newsgroup. The microsoft.public newsgroups suit this
purpose just fine. MSDN also, recently added forums in conjunction
with Windows Live. This would question would perfectly match the topic
of "Windows SDK" or "UI Development" on those forums. They can always
use more people to answer questions there. I have a few unanswered
questions there myself. Perhaps you should start lending a hand there.
If you would like to argue what is on and off topic, or that the FAQ
should be ignored, than let us hash that out.
.



  Page 1 of 1

1

 


Related Articles
 

NEWER

pg.1232     pg.940     pg.716     pg.544     pg.412     pg.311     pg.234     pg.175     pg.130     pg.96     pg.70     pg.50     pg.35     pg.24     pg.16     pg.10     pg.6     pg.3     pg.1

OLDER