|
|
|
|
||||||
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
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 |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
stewb85@gmail.com 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 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 |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
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 |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
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 , 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. |
|
![]() |
| Outils de la discussion | |
|
|