| 59 | // |
| 60 | |
| 61 | IFACEMETHODIMP ClassFactory::CreateInstance(IUnknown* pUnkOuter, REFIID riid, void** ppv) |
| 62 | { |
| 63 | HRESULT hr = CLASS_E_NOAGGREGATION; |
| 64 | |
| 65 | // pUnkOuter is used for aggregation. We do not support it in the sample. |
| 66 | if (pUnkOuter == nullptr) { |
| 67 | hr = E_OUTOFMEMORY; |
| 68 | |
| 69 | // Create the COM component. |
| 70 | GerberThumbnailProvider* pExt = new (std::nothrow) GerberThumbnailProvider(); |
| 71 | if (pExt) { |
| 72 | // Query the specified interface. |
| 73 | hr = pExt->QueryInterface(riid, ppv); |
| 74 | pExt->Release(); |
| 75 | } |
| 76 | } |
| 77 | |
| 78 | return hr; |
| 79 | } |
| 80 | |
| 81 | IFACEMETHODIMP ClassFactory::LockServer(BOOL fLock) |
| 82 | { |
nothing calls this directly
no test coverage detected