我想使用// m_handlers is a member of type std::vector<CComPtr<IAssocHandler>>
HRESULT FileManager::GetAssocHandlers(const std::wstring& strFileExtension, ASSOC_FILTER filter)
{
HRESULT hr = S_OK;
CComPtr<IEnumAssocHandlers> enumerator;
m_handlers.clear();
hr = SHAssocEnumHandlers(strFileExtension.c_str(), filter, &enumerator);
if (SUCCEEDED(hr))
{
for (CComPtr<IAssocHandler> handler;
enumerator->Next(1, &handler, nullptr) == S_OK;
handler.Release())
{
m_handlers.push_back(handler);
}
}
return hr;
}
HRESULT FileManager::GetAssociatedPrograms(BSTR bstrFileName, BSTR* bstrRet)
{
...
hr = GetAssocHandlers(strFileExtension, ASSOC_FILTER_RECOMMENDED);
if (SUCCEEDED(hr))
{
...
for (auto& handler : m_handlers)
{
...
if (SUCCEEDED(handler->GetIconLocation(&tmpStr, &resourceIndex)))
{
// And this is where I get classic full file path to regular
// applications like "MS Paint" or this weird path mentioned
// above for "Photos" UWP application for example which can't
// be used in regular ExtractIcon functions.
}
}
}
}
插件上传图片或图片。
但它没有上传图片:
dropzone
我的剧本:
<form enctype="multipart/form-data" id="my-awesome-dropzone" class="dropzone dz-clickable" action="http://www.****/Upload.php">
<div class="dropzone-previews"></div>
<button type="submit" class="btn btn-primary pull-left">Submit</button>
<div class="dz-default dz-message"><span>Drop files here to upload</span></div></form>
<div>
在我的控制台上我得到了这个回复: