Click here to Skip to main content
13,557,675 members
Click here to Skip to main content
Add your own
alternative version


17 bookmarked
Posted 15 Aug 2004
Licenced CPOL

Resourceless dialogs

, 16 Aug 2004
Rate this:
Please Sign up or sign in to vote.
How to create a resourceless dialog in wtl using the Resourceless Dialog Toolkit from


There is one problem if you have designed a dialog and you want to share it with other people. For example: I thinking about creating a typical "Tip of the Day" dialog able to read in a xml file. I wanted to share it with anyone who needs it. The problem was: How can I distribute the code without messing around with multiple resource scripts. I searched the Internet for a while and found some information about the Windows API. It was rather easy, but it had some nasty things you needed to look out for. Example all data had to be aligned at DWORD boundaries. I found out is was really hard to create a dialog without the dialog editor, so I wrote a small tool capable of parsing a resource script and export a dialog from it. I packet those two things together and the Resourceless Dialog Toolkit was born.

Using the code

I have spent a few hours to create documentation and a tutorial, so I'm giving you a small class showing you how the code works.

class CSampleDlg: public CResourcelessDlg<CSampleDlg>, 
  public CWinDataExchange<CSampleDlg>

  // Dialog function
  void CreateDlg()
    CreateDlgTemplate("About", DS_SETFONT|DS_MODALFRAME
      0, 0, 0, 186, 138, 8, "MS Sans Serif", "", "");
    AddStatic("Dialog Extractor v1.0", 0, 0, 60, 20, 67, 8, IDC_STATIC);
    AddStatic(IDR_MAINFRAME, SS_ICON, 0, 20, 20, 20, 20, 18);
    AddButton("", 0 | BS_GROUPBOX, 0, 7, 7, 172, 103, IDC_STATIC);
    AddStatic("(c) Copyright 2004", 0, 0, 60, 30, 58, 8, IDC_STATIC);
    AddStatic("By: Trilobyte-Solutions", 0, 0, 60, 41, 70, 8, IDC_STATIC);
    AddStatic("Updates and additional information about"
      " this program can be found at 
      the Trilobyte Solutions website.", 0, 0, 60, 59, 113, 26,  IDC_STATIC);
    AddStatic("", 0, 0, 60, 94, 84, 8, IDC_STATIC);
    AddButton("OK", 0|BS_DEFPUSHBUTTON, 0, 67, 117, 50, 14, IDOK);

    return IDOK;
As you see it is really easy to use the code. More information can be found in the documentation and tutorial inside the toolkit.

If you want to know more about the underlaying technique. Look one of the following items up in the MSDN: DLGTEMPLATE, DLGITEMTEMPLATE, CreateDialogIndirectParam and DialogBoxIndirectParam. If there are enough request, I will write a article about the Windows dialog API.

The Tip of the Day dialog

The dialog I told you about earlier in this article is not ready yet. At the end of the next week it probably will be ready.


The code is version 1.0. The tool is version 1.1, there were some bugs found.

Additional Information

For additional information, questions and bug report, visit my website:, or contact me at


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Technical Lead Premotion, Liones Internet BV
Netherlands Netherlands
I am Bert Willems a 24 year old developer living in Drachten, The Netherlands. I was born on 4 July 1985 in Drachten. My great passion is development of software, I simply love doing it. Since I was young I have been fascinated by technique and constructing things, first with Lego and later on things for the computer. I started with simple websites and some scripting of games, and then I decided I would make a career out of it and started with the development of business software. I am not sure why I love programming so much, but I know it has something to do with expressing my creativity in it.

You may also be interested in...

Comments and Discussions

QuestionCrash Pin
mezik1-Nov-15 3:04
membermezik1-Nov-15 3:04 
AnswerRe: Crash Pin
Member 1315871628-Apr-17 3:25
memberMember 1315871628-Apr-17 3:25 
Questionsmall changes Pin
toddma29-Aug-12 5:48
membertoddma29-Aug-12 5:48 
QuestionUpdates that would be useful. Pin
toddma29-Aug-12 5:24
membertoddma29-Aug-12 5:24 
GeneralNew location for the article downloads Pin
Trilobyte30-Apr-09 0:19
memberTrilobyte30-Apr-09 0:19 
GeneralVery Nice! [modified] Pin
mcc2vc5-Dec-08 15:23
membermcc2vc5-Dec-08 15:23 
GeneralSynchronicity! Pin
Jerry Evans16-Aug-04 5:25
memberJerry Evans16-Aug-04 5:25 
Generalsource code Pin
bishbosh0216-Aug-04 0:41
memberbishbosh0216-Aug-04 0:41 
GeneralRe: source code Pin
Mr. TriloByte16-Aug-04 3:50
memberMr. TriloByte16-Aug-04 3:50 
GeneralRe: source code Pin
bishbosh0216-Aug-04 19:55
memberbishbosh0216-Aug-04 19:55 
General[Message Deleted] Pin
Rodrigo Pinho Pereira de Souza1-Sep-05 5:49
memberRodrigo Pinho Pereira de Souza1-Sep-05 5:49 
GeneralRe: source code Pin
Ralph Walden24-Aug-04 4:27
memberRalph Walden24-Aug-04 4:27 
GeneralRe: source code Pin
Rodrigo Pinho Pereira de Souza2-Sep-05 8:50
memberRodrigo Pinho Pereira de Souza2-Sep-05 8:50 
GeneralDialog Extractor update Pin
Mr. TriloByte15-Aug-04 23:09
memberMr. TriloByte15-Aug-04 23:09 
Some bugs were found in this tool. The bugs are fixed, this article will be updated soon. The fixed toolkit can be downloaded from my website. If you have Dialog Extractor v1.1 you have the newest version.

QuestionSource code of the Resource extractor? Pin
Jeroen Walter15-Aug-04 22:02
sussJeroen Walter15-Aug-04 22:02 
AnswerRe: Source code of the Resource extractor? Pin
Mr. TriloByte15-Aug-04 23:02
memberMr. TriloByte15-Aug-04 23:02 
GeneralRe: Source code of the Resource extractor? Pin
Anonymous3-May-05 20:57
sussAnonymous3-May-05 20:57 
GeneralRe: Source code of the Resource extractor? Pin
Anonymous3-May-05 21:01
sussAnonymous3-May-05 21:01 
AnswerRe: Source code of the Resource extractor? Pin
Rodrigo Pinho Pereira de Souza2-Sep-05 8:48
memberRodrigo Pinho Pereira de Souza2-Sep-05 8:48 
Questionis it realy needed ? Pin
Mandalay15-Aug-04 20:00
memberMandalay15-Aug-04 20:00 
AnswerRe: is it realy needed ? Pin
Jeroen Walter15-Aug-04 22:13
sussJeroen Walter15-Aug-04 22:13 
GeneralRe: is it realy needed ? Pin
Ralph Walden24-Aug-04 4:18
memberRalph Walden24-Aug-04 4:18 
GeneralRe: is it realy needed ? Pin
Simon Cooke21-Jan-05 12:17
memberSimon Cooke21-Jan-05 12:17 
GeneralRe: is it realy needed ? Pin
Jeroen Walter24-Jan-05 3:34
memberJeroen Walter24-Jan-05 3:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.180515.1 | Last Updated 17 Aug 2004
Article Copyright 2004 by Trilobyte
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid