- CComPtr<IShellBrowser> shellBrowser;
- CComObject<CShellBrowser> *theCabinet;
- IEThreadParamBlock *parameters;
- HRESULT hResult;
-
- parameters = (IEThreadParamBlock *)lpThreadParameter;
- OleInitialize(NULL);
- ATLTRY (theCabinet = new CComObject<CShellBrowser>);
- if (theCabinet == NULL)
- return E_OUTOFMEMORY;
- hResult = theCabinet->QueryInterface(IID_PPV_ARG(IShellBrowser, &shellBrowser));
- if (FAILED(hResult))
- {
- delete theCabinet;
- return hResult;
- }
- hResult = theCabinet->Initialize(parameters->directoryPIDL, 0, 0, 0);
- if (FAILED(hResult))
- return hResult;
- ExplorerMessageLoop();
- OleUninitialize();
- return 0;
+ IEThreadParamBlock * parameters = (IEThreadParamBlock *) lpThreadParameter;
+ return ExplorerMessageLoop(parameters);