PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.cplus > Hello, basic question regarding checkboxes
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Hello, basic question regarding checkboxes

Réponse
 
LinkBack Outils de la discussion
Vieux 14/01/2008, 17h48   #1
stewb85@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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
  Réponse avec citation
Vieux 14/01/2008, 18h21   #2
Victor Bazarov
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Hello, basic question regarding checkboxes

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


  Réponse avec citation
Vieux 14/01/2008, 18h47   #3
Ron AF Greve
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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.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



  Réponse avec citation
Vieux 14/01/2008, 20h19   #4
Christopher
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Hello, basic question regarding checkboxes

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.

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 12h56.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,13126 seconds with 12 queries