Opened 20 years ago

Closed 20 years ago

Last modified 5 years ago

#8305 closed patch

GUI::OptionsDialog base class calls under MSVC6

Reported by: SF/jamieson630 Owned by: fingolfin
Priority: normal Component: GUI
Version: Keywords:
Cc: Game:

Description

The attached patch works around MSVC6's difficulties with the notation of explicit base class function calls in cases where the namespace of the base class is different than that of the derived class. Specifically, the patch is meant to correct [erroneous] compile-time errors related to calls made by Scumm::OptionsDialog to base class GUI::OptionsDialog methods of the same name. The trouble functions are open(), close() and handleCommand().

The patch creates "internal" versions of the necessary base class methods and puts the actual implementation there. The override functions just call the internal methods. In this way, the derived class can also call the base class implementation by using the internal methods, and thus avoid a name ambiguity.

This definitely muddies up the code a bit, and I'm not happy with that because we could find ourselves having to do in a variety of situations in the future, given our new namespace design. Any other ideas? Is this where we need to throw in the towel and abandon MSVC6 support entirely? :-)

Ticket imported from: #858731. Ticket imported from: patches/410.

Attachments (2)

options_dialog.diff (3.3 KB ) - added by SF/jamieson630 20 years ago.
Rev. 1 patch against December 12 CVS
options_dialog.rev2.diff (3.3 KB ) - added by SF/jamieson630 20 years ago.
Rev. 2 patch against December 12 CVS

Download all attachments as: .zip

Change History (10)

by SF/jamieson630, 20 years ago

Attachment: options_dialog.diff added

Rev. 1 patch against December 12 CVS

comment:1 by SF/jamieson630, 20 years ago

By the way, just to be completely clear -- the changes made in this patch do compile AND RUN PROPERLY under MSVC6, unlike my earlier solution that compiled but then crashed at run time. I had a bit more time to test this one properly. :)

comment:2 by SF/ender, 20 years ago

I really would prefer to keep MSVC6 support - as that's the only version of MSVC I have if I *do* need to do anything windows-related :)

comment:3 by fingolfin, 20 years ago

This patch is really really sick, though, and will cause us some nightmares in the future if we apply it, I fear (but of course I understand the motivation behind it).

Anyway, did you try this: 1) Rename Scumm::OptionsDialog to e.g. Scumm::ConfigDialog 2) Then, do a "typedef GUI::OptionsDialog OptionsDialog"

comment:4 by SF/jamieson630, 20 years ago

Changing Scumm::OptionsDialog to Scumm::ConfigDialog and creating the appropriate typedef for GUI::OptionsDialog also fixes the problem. Revised patch coming shortly. (In the middle of preparing for a three-day open-house starting in three hours.)

by SF/jamieson630, 20 years ago

Attachment: options_dialog.rev2.diff added

Rev. 2 patch against December 12 CVS

comment:5 by SF/jamieson630, 20 years ago

Rev 2 patch, based on Fingolfin's recommended solution, is now attached.

comment:6 by fingolfin, 20 years ago

Put into CVS. Not a really nice solution, but faaar better than the other approach :-)

comment:7 by fingolfin, 20 years ago

Status: newclosed

comment:8 by digitall, 5 years ago

Component: GUI
Note: See TracTickets for help on using tickets.