Creating a CList Box from a dialog Resource, using the dialog as the main Window

Creating a CList Box from a dialog Resource, using the dialog as the main Window

Post by Mark Wickm » Wed, 20 Mar 1996 04:00:00



Thanks for the reply Carl,

I have it sorted out now.

Are there any potential problems in keeping the pointer returned from
the  GetDlgItem() call as a member variable? Because I read in the
help files that the value returned from GetDlgItem can be temporary.

Also I have had a problem with getting the derived CCheckListBox to
work. Are there any tricks or traps to know about when using this
class ? I have been trying to use the method you mentioned in your
previous post to no avail (The Listbox appears with text, but no check
boxes appear)

Thanks
------------------------------------------------
Mark Wickman, Waterstone Leisure (UK)
http://ourworld.compuserve.com/homepages/Waterstone_Leisure_Shareware/

------------------------------------------------
              ** NEW RELEASE **
Download Manager for Win3.x & Win95
- Stores and manages downloaded files with Keywords,Abstract etc.-
ftp.demon.co.uk/pub/ibmpc/win3/apps/download
ftp.demon.co.uk/pub/ibmpc/win95/apps/download
------------------------------------------------

 
 
 

Creating a CList Box from a dialog Resource, using the dialog as the main Window

Post by Kit Kauffma » Wed, 20 Mar 1996 04:00:00




>Subject: Re: Creating a CList Box from a dialog Resource, using the dialog as the main Window
>Date: Tue, 19 Mar 1996 08:25:12 GMT
>Thanks for the reply Carl,
>I have it sorted out now.
>Are there any potential problems in keeping the pointer returned from
>the  GetDlgItem() call as a member variable? Because I read in the
>help files that the value returned from GetDlgItem can be temporary.

PMFJI, but don't keep the return value of CWnd::GetDlgItem (that pointer is
definitely temporary - CWinApp::OnIdle eats those up by design).

But you can safely keep GetDlgItem->GetSafeHwnd() - this is the Windows handle
to the object and is not temporary, or GetDlgItem->GetDlgCtrlID() is good
because you can use the ID to easily look up the item again with GetDlgItem
(unless the ID is -1, in which case the HWND is better).

Quote:>Also I have had a problem with getting the derived CCheckListBox to
>work. Are there any tricks or traps to know about when using this
>class ? I have been trying to use the method you mentioned in your
>previous post to no avail (The Listbox appears with text, but no check
>boxes appear)

Perhaps it requires the LBS_OWNERDRAWFIXED style bit?  Just a WAG...

>Thanks
>------------------------------------------------
>Mark Wickman, Waterstone Leisure (UK)
>http://ourworld.compuserve.com/homepages/Waterstone_Leisure_Shareware/

>------------------------------------------------
>              ** NEW RELEASE **
>Download Manager for Win3.x & Win95
>- Stores and manages downloaded files with Keywords,Abstract etc.-
>ftp.demon.co.uk/pub/ibmpc/win3/apps/download
>ftp.demon.co.uk/pub/ibmpc/win95/apps/download
>------------------------------------------------

HTH!


AKA 73363,447 (Compu$erve)

Finger me for my public key

 
 
 

Creating a CList Box from a dialog Resource, using the dialog as the main Window

Post by Mark Wickm » Thu, 21 Mar 1996 04:00:00




>PMFJI, but don't keep the return value of CWnd::GetDlgItem (that pointer is
>definitely temporary - CWinApp::OnIdle eats those up by design).

>But you can safely keep GetDlgItem->GetSafeHwnd() - this is the Windows handle
>to the object and is not temporary, or GetDlgItem->GetDlgCtrlID() is good
>because you can use the ID to easily look up the item again with GetDlgItem
>(unless the ID is -1, in which case the HWND is better).

Ahhhh. Thanks for that.

Quote:>>Also I have had a problem with getting the derived CCheckListBox to
>>work. Are there any tricks or traps to know about when using this
>>class ? I have been trying to use the method you mentioned in your
>>previous post to no avail (The Listbox appears with text, but no check
>>boxes appear)

>Perhaps it requires the LBS_OWNERDRAWFIXED style bit?  Just a WAG...

I hope not.  That would mean CCheckListBox must be a virtual base
class and I would have to derive and add functionality which defeats
the purpose of having the class in MFC (In my opinion anyway). I
suppose I should have a rummage around the source code to see what the
story is.

Thanks
------------------------------------------------
Mark Wickman, Waterstone Leisure (UK)
http://ourworld.compuserve.com/homepages/Waterstone_Leisure_Shareware/

------------------------------------------------
              ** NEW RELEASE **
Download Manager for Win3.x & Win95
- Stores and manages downloaded files with Keywords,Abstract etc.-
ftp.demon.co.uk/pub/ibmpc/win3/apps/download
ftp.demon.co.uk/pub/ibmpc/win95/apps/download
------------------------------------------------

 
 
 

1. Resource ID Collision between main dialog and custom dll dialog??

Help?!

I am running into a problem using MFC dialogs where I have an app with a
dialog interface that later calls a dll that attempts to open a child
dialog to display process progress.  My problem is that my DLL when
referencing the progress dialog is affecting the main applications dialog.
In investigating this problem I discovered that the main dialog ID is equal
to the id of the child dialog - however since the two dialogs are in
separate rc files and are compiled separately I am confused as to why I am
experiencing this collision.  

Any help would be appreciated. - Certainly I can renumber the dialog ID of
the progress dialog, but that isn't the answer I think I need.

Thanks

John Clark
(standard disclaimer applies).

2. Help: Send To Email Message in Body

3. Resizing dialog Box or Elastic control tool for Dialog Boxes.

4. 0x800703E6

5. Change Properties of Dialog Box created by Borland Resource Workshop

6. XP SP1 worth installing?

7. how to create a child dialog window on a dialog base application with MFC

8. NetBIOS over TCP/IP Question

9. a 2nd dialog without blocking main-dialogs focus?

10. Why does the second Dialog block the main Dialog?

11. Question: Displaying dialog from resource in main window

12. Is it possible to hide a main window Dialog Box?

13. Dialog box as main window with menu ?