Exetools  

Go Back   Exetools > General > General Discussion

Notices

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 08-13-2014, 21:26
BlackWhite BlackWhite is offline
Friend
 
Join Date: Apr 2013
Posts: 80
Rept. Given: 4
Rept. Rcvd 14 Times in 6 Posts
Thanks Given: 12
Thanks Rcvd at 48 Times in 21 Posts
BlackWhite Reputation: 14
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?
   }
}
Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


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


All times are GMT +8. The time now is 16:44.


Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX, chessgod101
( 1998 - 2024 )