|
-
Dec 1st, 2001, 08:38 AM
#1
Thread Starter
New Member
adding controls on the fly to dialogs
Hi,
Could anyone please tell me how to add controls to dialogs dynamically? (I'm using VC++ not VB.)
If anyone here has used Photoshop, what I'm trying to achieve is something like the Layers toolbox in Photoshop, where layer names appear dynamically when the user creates them.
I did see a solution to this problem at http://www.mooremvp.freeserve.co.uk/Win32/w32tip57.htm but I'm a beginner and I don't understand how to use the supplied code in MFC.
Could someone please help me? Thanks very much in advance.
Murli.
-
Dec 2nd, 2001, 09:16 AM
#2
Monday Morning Lunatic
Re: adding controls on the fly to dialogs
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Dec 2nd, 2001, 12:10 PM
#3
Thread Starter
New Member
-
Dec 3rd, 2001, 05:56 PM
#4
Monday Morning Lunatic
Visual C++ is a compiler/IDE.
SDK == Software Development Kit
The Win32 API is mostly supported by the PSDK - the Platform SDK. This encompasses the MSDN documentation for nearly everything of interest to Win32 developers.
It's available as a download, and also comes with updated headers/libraries so you can take early advantage of improvements to the API.
However, what you can do easily is to define your dialogue resource using the editor, then update the actual WINDOW (the HWND) using CreateWindow. There is a way to assign an ID to a child window (i.e. a control) using CreateWindow but I can't remember off the top of my head.
However, the code in the SDK is more likely to be C, rather than C++.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Dec 9th, 2001, 07:49 AM
#5
Thread Starter
New Member
thanks that explains a lot 
what you can do easily is to define your dialogue resource using the editor, then update the actual WINDOW (the HWND) using CreateWindow.
CreateWindow is still not part of VC++, right? so i still have to download the SDK? i'm guessing that this is so since HWND enters the picture. Or can HWND objects be directly manipulated in VC?
Sorry if these are very dumb questions.
-
Dec 9th, 2001, 07:56 AM
#6
Monday Morning Lunatic
Of course it's part of VC++.
EVERY windows program has to call CreateWindow at some point, even MFC (even though it's miles down the layers).
An HWND is actually just an arbitrary numeric value chosen to represent the window (i.e. Windows knows what window it refers to, but you don't until you call some functions using it).
Basically, just call CreateWindow.
The SDK has updated headers, as well as the documentation.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Dec 9th, 2001, 08:11 AM
#7
Thread Starter
New Member
wonderful! thanks a lot!
that simplifies things quite a bit for me.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|