Skip to main content
Participating Frequently
February 17, 2010
Answered

Creating Custom Dialog Box in FDK

  • February 17, 2010
  • 1 reply
  • 1253 views

Hi,

  I've created a custom dialog box and generated the .dlg and the .xdi files for the Windows platform.

  How are these files to be included in a Visual Studio FDK project?

  I have seen the sample/dialog example, but it already has these files included.

  I'm wondering whats the process is to include these files in a new project.

Thanks,

Anupam.

    This topic has been closed for replies.
    Correct answer Russ Ward

    Hi Anupam,

    They need to make it into your resource script (*.rc) file, assuming you have created one. If you have not, follow the directions in the Windows Platform guide. After creating the script, the directions will tell you to use a View > Resouce Includes path, which is valid on older Visual Studio versions. If you are using VS 2008 (Visual C++ 9), you'll need to open up the Resource View tab in the Solution Explorer (by double-clicking the *.rc file), then you can right-click on the *.rc item and Resource Includes will be in the menu.

    Once in the *.rc file, it will look something like this, if you were to open it in a text editor;

    3 TEXTINCLUDE
    BEGIN
        "#include ""MyDialog.dlg""\r\n"
        "#include ""MyDialog.xdi""\r\n"
       
    END

    Russ

    1 reply

    Russ WardCorrect answer
    Legend
    February 17, 2010

    Hi Anupam,

    They need to make it into your resource script (*.rc) file, assuming you have created one. If you have not, follow the directions in the Windows Platform guide. After creating the script, the directions will tell you to use a View > Resouce Includes path, which is valid on older Visual Studio versions. If you are using VS 2008 (Visual C++ 9), you'll need to open up the Resource View tab in the Solution Explorer (by double-clicking the *.rc file), then you can right-click on the *.rc item and Resource Includes will be in the menu.

    Once in the *.rc file, it will look something like this, if you were to open it in a text editor;

    3 TEXTINCLUDE
    BEGIN
        "#include ""MyDialog.dlg""\r\n"
        "#include ""MyDialog.xdi""\r\n"
       
    END

    Russ

    Participating Frequently
    February 18, 2010

    Thanks Russ! That was what I needed. I'm copying here the directions, from the FDK Windows guide in case someone else is looking.

    ------------------------------------------------------------------------------------------------------------------------------------------

    Using custom dialog boxes
    The FDK samples include a template document for designing custom dialog boxes. You open
    this document in FrameMaker and edit it with the FrameMaker graphic tools and commands.
    FDK 7.2 Platform Guide, Windows 27
    Compiling, Registering, and Running FDK Clients 4
    When you save a custom dialog box in a Windows version of FrameMaker, it generates two
    Windows resource definition files, a .dlg file and a .xdi file.
    ● The .dlg file is a text file containing resource statements. These statements are standard
    Windows descriptions of the dialog box and its controls.
    ● The .xdi file is a text file containing a user-defined resource statement. This statement
    contains data used by FrameMaker to manipulate the dialog boxes.
    When creating the .dlg and .xdi files, FrameMaker uses the name of the .dre file
    (without the extension) to name the files and the actual dialog resource. For example, when
    saving the file named mydlg.dre, FrameMaker creates the resource description files
    mydlg.dlg and mydlg.xdi. Both files describe the dialog resource named mydlg.
    To compile the .dlg and .xdi files in your dll you must create a resource for the project, and
    provide directives to include these files in the resource. In the process of compiling the client,
    these resource definition files are compiled into a single resource file (.rc). This resource file
    is linked to your client.
    To set up the resource definition files to be compiled, follow these general steps:
    1. Start Development Environment 2003 (Version 7.1).
    2. If one doesn’t already exist for the project, create a resource script.
    Choose Add New Item from the File menu. The Add New Item dialog box appears. Choose
    Resource File.
    3. Include the resource description files generated by FrameMaker.
    Choose Resource Includes from the Edit menu. The Resource Includes dialog box appears.
    In the Compile-Time Directives field, type #include statements to include the resource
    description files.
    For example, suppose you create two custom dialog boxes named pgftag.dre and
    chartag.dre. When FrameMaker saves these files it also creates the files pgftag.dlg,
    pgftag.xdi, chartag.dlg, and chartag.xdi.
    To include these files in the resource script, type the following in the Compile-Time
    Directives field:
    #include "pgftag.dlg"
    #include "pgftag.xdi"
    #include "chartag.dlg"
    #include "chartag.xdi"
    Make sure you use the correct syntax; Development Environment 2003 (Version 7.1) does
    not check the syntax or warn you of this before you dismiss the dialog box.
    4. Save the resource script.
    For information on adding your resource script to your client, see “Compiling and
    registering the client” on page 24.
    4 Compiling, Registering, and Running FDK Clients
    28 FDK 7.2 Platform Guide, Windows
    Compiling clients with custom dialog boxes
    If your FDK client uses custom dialog boxes, you need to specify a special link option before
    compiling it:
    1. In Development Environment 2003 (Version 7.1), choose Project->Properties.
    This displays the Project Properties dialog box.
    2. Choose Linker and then Command Line.
    3. Add the following option to the Additional Options field:
    /section:.rsrc,w
    This link option makes the dialog resources writable. If you do not specify it before
    compiling, your FDK client may exit unexpectedly when it attempts to display a custom
    dialog box.
    4. Repeat steps 3 for each target in your project.
    Making adjustments to custom dialog boxes
    Since the .dlg files produced by FrameMaker are text files containing resource statements,
    you can open these files in Development Environment 2003 (Version 7.1) as resources. You
    can use the built-in tools for dialog editing to view, adjust, and test the dialog box.
    Because you are modifying the .dlg file but not the .xdi file, you should not make major
    changes to the dialog box (for example, do not add new items to the dialog box). If you do, the
    description in the .dlg file will not match the description in the .xdi file.