CanAddClass

 

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

Called by the wizard to verify that the project is compatible with the code wizard the user is trying to run.

  
      function CanAddClass(   
   oProj,   
   oObject    
);  

Parameters

oProj
The selected project.

oObject
The selected object. In this case, the current project.

true if the class can be added; otherwise false.

The wizard calls this function when the parameter PREPROCESS_FUNCTION is in the project control's .vsz file.

It verifies if the Visual C++ Code Model object is available. If the code model is not available, the function reports an error and returns false.

// Determine if a class can be added to the project  
if (CanAddClass(selProj, selObj))  
{  
   return true;  
}  

Customizing C++ Wizards with Common JScript Functions
JScript Functions for C++ Wizards
Creating a Custom Wizard
Designing a Wizard
CanAddMFCClass
CanAddATLClass
IsMFCProject

Show: