Share via


GetCodeForExitInstance

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at GetCodeForExitInstance.

Gets the ExitInstance code for terminating the wizard.

Syntax

  
      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.

Return Value

A string containing the code for exiting the wizard instance.

Remarks

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

Line number ExitInstance code
0 _AtlModule.RevokeClassObjects();
1 return 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).

Example

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();  
   }  
  

See Also

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