Get the FullName property from the Solution object
| 188 | |
| 189 | //! Get the FullName property from the Solution object |
| 190 | HRESULT GetSolutionFullName(IDispatch* vsSolution, std::string& fullName) |
| 191 | { |
| 192 | HRESULT hr = E_POINTER; |
| 193 | |
| 194 | if (0 != vsSolution) { |
| 195 | DISPID dispid = (DISPID)-1; |
| 196 | wchar_t full_name[] = L"FullName"; |
| 197 | OLECHAR* name = full_name; |
| 198 | |
| 199 | hr = vsSolution->GetIDsOfNames(IID_NULL, &name, 1, LOCALE_USER_DEFAULT, |
| 200 | &dispid); |
| 201 | ReportHRESULT(hr, "GetIDsOfNames(FullName)"); |
| 202 | |
| 203 | if (SUCCEEDED(hr)) { |
| 204 | DISPPARAMS params; |
| 205 | VARIANT result; |
| 206 | EXCEPINFO excep; |
| 207 | UINT arg = (UINT)-1; |
| 208 | |
| 209 | params.rgvarg = 0; |
| 210 | params.rgdispidNamedArgs = 0; |
| 211 | params.cArgs = 0; |
| 212 | params.cNamedArgs = 0; |
| 213 | |
| 214 | VariantInit(&result); |
| 215 | |
| 216 | memset(&excep, 0, sizeof(excep)); |
| 217 | |
| 218 | hr = vsSolution->Invoke(dispid, IID_NULL, LOCALE_USER_DEFAULT, |
| 219 | DISPATCH_PROPERTYGET, ¶ms, &result, &excep, |
| 220 | &arg); |
| 221 | ReportHRESULT(hr, "Invoke(FullName)"); |
| 222 | |
| 223 | if (SUCCEEDED(hr)) { |
| 224 | fullName = (std::string)(_bstr_t)V_BSTR(&result); |
| 225 | } |
| 226 | |
| 227 | VariantClear(&result); |
| 228 | } |
| 229 | } |
| 230 | |
| 231 | return hr; |
| 232 | } |
| 233 | |
| 234 | //! Get the FullName property from the Solution object, given the IDE object |
| 235 | HRESULT GetIDESolutionFullName(IDispatch* vsIDE, std::string& fullName) |
no test coverage detected
searching dependent graphs…