Patrick Craig > IRIS Explorer > Module Builder Tips

Patrick's IRIS Explorer Tips for Module Builders

  1. Selecting directory for new module
  2. When you create a new module in the module builder, it creates it in the current directory. On unix you can just start mbuilder from the directory in which you want to build the module. On Windows, you normally start the module builder from the Start Menu. There are two ways of selecting where the module will be built:
    1. Choose File | Open..., change to the required directory and press Cancel. This changes the current directory.
    2. Once you have given the module a name, select File | Save As... and save in the required directory.

  3. Building modules debug
  4. In order to build modules debug you have to set the Debug flag from the Build menu and rebuild the module.

  5. Debugging modules
  6. If your debug module crashes, you can find out where it crashed by examining the core file on Unix. On Windows, you should be given the option of launching the Visual C++ debugger when a module crashes. If you want to step through the code using a debugger you launch the module, attach to the running process, set a breakpoint (note on Windows: VC++ sometimes ignores the first breakpoint so set two on consecutive lines) and then fire the module. See debugger documentation for how to attach to a process, set breakpoints, etc.

    How do I attach to a module that crashes as soon as it fires?
    If your module crashes as soon as you launch it in the map editor, Explorer asks if you want to replace it. If you replace the module, it will be launched disabled so it won't crash (unless the crash is in an initialisation hook function). You can then attach the debugger and enable the module.

    What if it crahses in an initialisation hook function?
    One method is to add the following line to the start of your initialisation hook function:


    When you launch the module, it will get stuck in a continuous while loop. You then attach the debugger and interrupt/break execution. Then you get the debugger to jump to the line after the while loop ("Set next statement" on VC++).

  7. Filenames and cxFilenameExpand
  8. If you write a module that has text widgets that contain filenames, always filter the filename through cxFilenameExpand.

Under Construction...