![]() |
|
#1
|
|||
|
|||
|
How to call the original function when it's overridden?
MFC has a class named CWinApp, and CWinApp has a destruction
function called ~CWinApp(). Now I want to override ~CWinApp() yet still want to call the original version of ~CWinApp(), the code is as follows: Code:
void wrap(void)
{
CWinApp::~CWinApp();
}
CWinApp::~CWinApp()
{
if(GetCurrentProcessId() != process_id)
return; // do nothing!
else
{
wrap(); // It seems wrap() calls the overridden ~CWinApp(),
// not the original one, thus it should not be called here.
// Then, how to call the original ~CWinApp() here?
}
}
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [C] Helper function to call arbitrary x86 Delphi functions | zeffy | Source Code | 0 | 04-13-2018 10:25 |