Connecting Tech Pros Worldwide Forums | Help | Site Map

Hello, basic question regarding checkboxes

stewb85@gmail.com
Guest
 
Posts: n/a
#1: Jan 14 '08
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

Victor Bazarov
Guest
 
Posts: n/a
#2: Jan 14 '08

re: Hello, basic question regarding checkboxes


stewb85@gmail.com wrote:
Quote:
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.
Quote:
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.
Quote:
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


Ron AF Greve
Guest
 
Posts: n/a
#3: Jan 14 '08

re: Hello, basic question regarding checkboxes


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.comwrote in message
news:e898ab3b-343c-4314-ab24-80a09faee94c@k2g2000hse.googlegroups.com...
Quote:
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

Christopher
Guest
 
Posts: n/a
#4: Jan 14 '08

re: Hello, basic question regarding checkboxes


On Jan 14, 12:47 pm, "Ron AF Greve" <ron@localhostwrote:
Quote:
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.

Closed Thread