Share via


GetCodeForExitInstance

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.

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

Tasks

Creating a Custom Wizard

Concepts

Customizing C++ Wizards with Common JScript Functions

Designing a Wizard

Reference

GetCodeForDllCanUnloadNow

GetCodeForInitInstance

Other Resources

JScript Functions for C++ Wizards