Get the Solution object from the IDE object
| 144 | |
| 145 | //! Get the Solution object from the IDE object |
| 146 | HRESULT GetSolutionObject(IDispatch* vsIDE, IDispatchPtr& vsSolution) |
| 147 | { |
| 148 | HRESULT hr = E_POINTER; |
| 149 | |
| 150 | if (0 != vsIDE) { |
| 151 | DISPID dispid = (DISPID)-1; |
| 152 | wchar_t solution[] = L"Solution"; |
| 153 | OLECHAR* name = solution; |
| 154 | |
| 155 | hr = |
| 156 | vsIDE->GetIDsOfNames(IID_NULL, &name, 1, LOCALE_USER_DEFAULT, &dispid); |
| 157 | ReportHRESULT(hr, "GetIDsOfNames(Solution)"); |
| 158 | |
| 159 | if (SUCCEEDED(hr)) { |
| 160 | DISPPARAMS params; |
| 161 | VARIANT result; |
| 162 | EXCEPINFO excep; |
| 163 | UINT arg = (UINT)-1; |
| 164 | |
| 165 | params.rgvarg = 0; |
| 166 | params.rgdispidNamedArgs = 0; |
| 167 | params.cArgs = 0; |
| 168 | params.cNamedArgs = 0; |
| 169 | |
| 170 | VariantInit(&result); |
| 171 | |
| 172 | memset(&excep, 0, sizeof(excep)); |
| 173 | |
| 174 | hr = vsIDE->Invoke(dispid, IID_NULL, LOCALE_USER_DEFAULT, |
| 175 | DISPATCH_PROPERTYGET, ¶ms, &result, &excep, &arg); |
| 176 | ReportHRESULT(hr, "Invoke(Solution)"); |
| 177 | |
| 178 | if (SUCCEEDED(hr)) { |
| 179 | vsSolution = V_DISPATCH(&result); |
| 180 | } |
| 181 | |
| 182 | VariantClear(&result); |
| 183 | } |
| 184 | } |
| 185 | |
| 186 | return hr; |
| 187 | } |
| 188 | |
| 189 | //! Get the FullName property from the Solution object |
| 190 | HRESULT GetSolutionFullName(IDispatch* vsSolution, std::string& fullName) |
no test coverage detected
searching dependent graphs…