Condividi tramite


CanAddMFCClass

 

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

Called by the wizard to verify that the user can add an MFC class to the project.

Syntax

  
      function CanAddMFCClass(   
   oProj,   
   oObject    
);  

Parameters

oProj
Selected project

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

Return Value

true if the class can be added; false if the user calls the function for a project that is not an MFC project and does not have MFC support.

Remarks

Called by the wizard to verify if the project is compatible with the Code Wizard that is about to be run (in other words, it can accept an MFC class).

The wizard calls this function when the parameter PREPROCESS_FUNCTION is in the project control's .vsz file and checks if the Visual C++ Code Model object is available. If the code model is not available, the function reports an error and returns false.

Example

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

See Also

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