0

I have written a C++ VSPackge which has code like this

// Command handler called when the user selects the "My Command" command. void OnMyCommand(CommandHandler* /pSender/, DWORD /flags/, VARIANT* /pIn/, VARIANT* /pOut/) { HRESULT hr = S_OK;

CComPtr<IVsDebugger> spDebugger = nullptr;
hr = this->GetVsSiteCache().QueryService<IVsDebugger>( IID_IVsDebugger, &spDebugger );
if(FAILED( hr ))
{
    return;
}

DBGMODE dbgMode;

hr = spDebugger->GetMode( &dbgMode );
if(FAILED( hr ))
{
    return;
}

if(dbgMode == DBGMODE::DBGMODE_Design)
{
    // Need to get the current project's debug settings before calling 
    // IVsDebugger::Launch**    
}

I tried to get different services (IVsProjectCfg, IVsSolutionBuildManager) all of which failed.

Uday
  • 150
  • 1
  • 5
  • ,Thanks for sharing your solution here, if possible, you could mark it as the answer, so it could help other community members who get the same issue find the answer easily. Have a nice day:) – Jack Zhai Mar 01 '18 at 08:11