Export (0) Print
Expand All

GetCodeForExitInstance

Gets the ExitInstance code for terminating the wizard.

function GetCodeForExitInstance( 
   nLineStart, 
   nLineEnd  
) 

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 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).

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();
   }
Show:
© 2014 Microsoft