| title | GetCodeForExitInstance | Microsoft Docs | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ms.custom | ||||||||||||||
| ms.date | 11/04/2016 | |||||||||||||
| ms.reviewer | ||||||||||||||
| ms.suite | ||||||||||||||
| ms.technology |
|
|||||||||||||
| ms.tgt_pltfrm | ||||||||||||||
| ms.topic | article | |||||||||||||
| f1_keywords |
|
|||||||||||||
| dev_langs |
|
|||||||||||||
| helpviewer_keywords |
|
|||||||||||||
| ms.assetid | 41fe3d79-a1f4-4bb5-b3f5-7859e255b4e7 | |||||||||||||
| caps.latest.revision | 7 | |||||||||||||
| author | mikeblome | |||||||||||||
| ms.author | mblome | |||||||||||||
| manager | ghogen | |||||||||||||
| translation.priority.ht |
|
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();
}
Customizing C++ Wizards with Common JScript Functions
JScript Functions for C++ Wizards
Creating a Custom Wizard
Designing a Wizard
GetCodeForDllCanUnloadNow
GetCodeForInitInstance