vs_integration/src/Commands.cpp
//------------------------------------------------------------------------------
// This function determines the current project and calls StartCodeRover
// with the appropriate arguments.
//------------------------------------------------------------------------------
This function determines the current project and calls StartCodeRover
with the appropriate arguments.
This function determines the current project and calls StartCodeRover with the appropriate arguments .
STDMETHODIMP CCommands::CodeRoverBuildMethod() 
{
	AFX_MANAGE_STATE(AfxGetStaticModuleState());
	CComPtr<IDispatch> pProject;
	m_pApplication->get_ActiveProject(&pProject);
	if(pProject != NULL) {
		IGenericProject *p = NULL;
		pProject.QueryInterface(&p);
		CComBSTR bszProjectName("");
		CComBSTR bszProjectFileName("");
		p->get_Name(&bszProjectName);
		p->get_FullName(&bszProjectFileName);
		p->Release();
		StartCodeRover(CString(BSTR(bszProjectName)), CString(BSTR(bszProjectFileName)));
	} else {
		StartCodeRover(NULL, NULL);
	}
	return S_OK;
}
STDMETHODIMP CCommands :: CodeRoverBuildMethod ( ) { AFX_MANAGE_STATE ( AfxGetStaticModuleState ( ) ) ; CComPtr < IDispatch > pProject ; m_pApplication -> get_ActiveProject ( & pProject ) ; if ( pProject != NULL ) { IGenericProject * p = NULL ; pProject . QueryInterface ( & p ) ; CComBSTR bszProjectName ( " " ) ; CComBSTR bszProjectFileName ( " " ) ; p -> get_Name ( & bszProjectName ) ; p -> get_FullName ( & bszProjectFileName ) ; p -> Release ( ) ; StartCodeRover ( CString ( BSTR ( bszProjectName ) ) , CString ( BSTR ( bszProjectFileName ) ) ) ; } else { StartCodeRover ( NULL , NULL ) ; } return S_OK ; }
This function determines the current project and calls StartCodeRover
with the appropriate arguments.
This function determines the current project and calls StartCodeRover with the appropriate arguments .
/*
	VERIFY_OK(m_pApplication->EnableModeless(VARIANT_FALSE));
	::MessageBox(NULL, "VSAddIn Command invoked.", "VSAddIn", MB_OK | MB_ICONINFORMATION);
	VERIFY_OK(m_pApplication->EnableModeless(VARIANT_TRUE));
	*/