#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)
Change History (10)
by , 21 years ago
Attachment: | options_dialog.diff added |
---|
comment:1 by , 21 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 , 21 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 , 21 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 , 21 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.)
comment:5 by , 21 years ago
Rev 2 patch, based on Fingolfin's recommended solution, is now attached.
comment:6 by , 21 years ago
Put into CVS. Not a really nice solution, but faaar better than the other approach :-)
comment:7 by , 21 years ago
Status: | new → closed |
---|
comment:8 by , 6 years ago
Component: | → GUI |
---|
Rev. 1 patch against December 12 CVS