GetCodeForDllCanUnloadNow

 

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

Gets the appropriate code for unloading the DLL.

  
      function GetCodeForDllCanUnloadNow(   
   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 unloading the DLL.

Call this member function to retrieve the appropriate code for unloading the DLL. Calling this function creates a single string by concatenating the array elements you specify.

The following table shows code for unloading the DLL.

Line numberCode
0AFX_MANAGE_STATE(AfxGetStaticModuleState());
1if (_AtlModule.GetLockCount() > 0)
2\treturn S_FALSE;
3return S_OK;

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

// Get the lines numbered 1 and 2 above  
GetCodeForDllCanUnloadNow(1, 2)  
  
// returns the following string  
// "\tif (_AtlModule.GetLockCount() > 0)\r\n\t\treturn S_FALSE;\r\n"  
  

Customizing C++ Wizards with Common JScript Functions
JScript Functions for C++ Wizards
Creating a Custom Wizard
Designing a Wizard
GetCodeForDllGetClassObject
GetCodeForExitInstance

Show: