It is not advisable to stitch RAW files.
A RAW file is like a negative and needs to be processed. The processing gives the opportunity to correct short comings of the camera sensor and the scene in general.
Correcting Vignetting, Chromatic Aberration, Noise/Grain, Sharpness and colour balance and exporting the 16 bit .tif format will allow greater auto control point placement for stitching.
For RAW conversion look to Adobe Camera Raw via Photoshop or Lightroom, Canon's own DPP or DxO Optics etc.
That said, your RAW file should open and stitch. Though the models Canon make are 30D, 40D and 5D. The D40 is a Nikon modal.
RAW files will take up a great deal of memory and is likely you are running low when you say the bar disappears.
Regards, Smooth