GetCodeForExitInstance

 

For the latest documentation on Visual Studio 2017, see Visual Studio 2017 Documentation.

For the latest documentation on Visual Studio 2017, see GetCodeForExitInstance on docs.microsoft.com. Gets the ExitInstance code for terminating the wizard.

  
      function GetCodeForExitInstance(   
   nLineStart,   
   nLineEnd    
)   

Parameters

nLineStart
The zero-based line number for the start of the function.

nLineEnd
The zero-based line number for the end of the function.

A string containing the code for exiting the wizard instance.

Call this member function to retrieve the appropriate code for exiting an instance of the wizard:

Line numberExitInstance code
0_AtlModule.RevokeClassObjects();
1return CWinApp::ExitInstance();

For each of the lines returned, GetCodeForExitInstance adds a leading tab (\t) and a trailing "CR-LF" (carriage return - linefeed) character pair (\r\n).

if (!oExitInstance)  
   {  
      oExitInstance = oCWinApp.AddFunction("ExitInstance",   
      vsCMFunctionFunction, "BOOL", vsCMAddPositionEnd, vsCMAccessPublic,   
      strProjectCPP);  
      oExitInstance.BodyText = GetCodeForExitInstance(0, 1);  
   }  
// returns the following string  
// "\t_AtlModule.RevokeClassObjects();\r\n  
// \treturn CWinApp::ExitInstance();\r\n"  
else  
   {  
   oExitInstance.StartPointOf(vsCMPartBody,   
   vsCMWhereDefinition).CreateEditPoint().Insert(GetCodeForExitInstance(0,   
   0));  
// returns the following string  
// "\t_AtlModule.RevokeClassObjects();\r\n  
      oCM.Synchronize();  
   }  
  

Customizing C++ Wizards with Common JScript Functions
JScript Functions for C++ Wizards
Creating a Custom Wizard
Designing a Wizard
GetCodeForDllCanUnloadNow
GetCodeForInitInstance

Show: