Patrick Craig > IRIS Explorer > Module Builder Tips
Patrick's IRIS Explorer Tips for Module Builders
- Selecting directory for new module
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.
- Building modules debug
In order to build modules debug you have to set the Debug flag from the Build
menu and rebuild the module.
- Debugging modules
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:
while(1);
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++).
- Filenames and cxFilenameExpand
If you write a module that has text widgets that contain filenames,
always filter the filename through cxFilenameExpand.
Under Construction...