您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ IID_PPV_ARGS函数代码示例

51自学网 2021-06-01 21:29:04
  C++
这篇教程C++ IID_PPV_ARGS函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中IID_PPV_ARGS函数的典型用法代码示例。如果您正苦于以下问题:C++ IID_PPV_ARGS函数的具体用法?C++ IID_PPV_ARGS怎么用?C++ IID_PPV_ARGS使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了IID_PPV_ARGS函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: ThrowIfFailed

// Load the sample assets.void D3D12Fullscreen::LoadAssets(){    // Create an empty root signature.    {        CD3DX12_ROOT_SIGNATURE_DESC rootSignatureDesc;        rootSignatureDesc.Init(0, nullptr, 0, nullptr, D3D12_ROOT_SIGNATURE_FLAG_ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT);        ComPtr<ID3DBlob> signature;        ComPtr<ID3DBlob> error;        ThrowIfFailed(D3D12SerializeRootSignature(&rootSignatureDesc, D3D_ROOT_SIGNATURE_VERSION_1, &signature, &error));        ThrowIfFailed(m_device->CreateRootSignature(0, signature->GetBufferPointer(), signature->GetBufferSize(), IID_PPV_ARGS(&m_rootSignature)));        NAME_D3D12_OBJECT(m_rootSignature);    }    // Create the pipeline state, which includes compiling and loading shaders.    {        ComPtr<ID3DBlob> vertexShader;        ComPtr<ID3DBlob> pixelShader;        ComPtr<ID3DBlob> error;#if defined(_DEBUG)        // Enable better shader debugging with the graphics debugging tools.        UINT compileFlags = D3DCOMPILE_DEBUG | D3DCOMPILE_SKIP_OPTIMIZATION;#else        UINT compileFlags = 0;#endif        ThrowIfFailed(D3DCompileFromFile(GetAssetFullPath(L"shaders.hlsl").c_str(), nullptr, nullptr, "VSMain", "vs_5_0", compileFlags, 0, &vertexShader, &error));        ThrowIfFailed(D3DCompileFromFile(GetAssetFullPath(L"shaders.hlsl").c_str(), nullptr, nullptr, "PSMain", "ps_5_0", compileFlags, 0, &pixelShader, &error));        // Define the vertex input layout.        D3D12_INPUT_ELEMENT_DESC inputElementDescs[] =        {            { "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 0, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 },            { "COLOR", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, 12, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 }        };        // Describe and create the graphics pipeline state object (PSO).        D3D12_GRAPHICS_PIPELINE_STATE_DESC psoDesc = {};        psoDesc.InputLayout = { inputElementDescs, _countof(inputElementDescs) };        psoDesc.pRootSignature = m_rootSignature.Get();        psoDesc.VS = CD3DX12_SHADER_BYTECODE(vertexShader.Get());        psoDesc.PS = CD3DX12_SHADER_BYTECODE(pixelShader.Get());        psoDesc.RasterizerState = CD3DX12_RASTERIZER_DESC(D3D12_DEFAULT);        psoDesc.BlendState = CD3DX12_BLEND_DESC(D3D12_DEFAULT);        psoDesc.DepthStencilState.DepthEnable = FALSE;        psoDesc.DepthStencilState.StencilEnable = FALSE;        psoDesc.SampleMask = UINT_MAX;        psoDesc.PrimitiveTopologyType = D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE;        psoDesc.NumRenderTargets = 1;        psoDesc.RTVFormats[0] = DXGI_FORMAT_R8G8B8A8_UNORM;        psoDesc.SampleDesc.Count = 1;        ThrowIfFailed(m_device->CreateGraphicsPipelineState(&psoDesc, IID_PPV_ARGS(&m_pipelineState)));        NAME_D3D12_OBJECT(m_pipelineState);    }    // Create the command list.    ThrowIfFailed(m_device->CreateCommandList(0, D3D12_COMMAND_LIST_TYPE_DIRECT, m_commandAllocators[m_frameIndex].Get(), m_pipelineState.Get(), IID_PPV_ARGS(&m_commandList)));    NAME_D3D12_OBJECT(m_commandList);    LoadSizeDependentResources();    // Close the command list and execute it to begin the vertex buffer copy into    // the default heap.    ThrowIfFailed(m_commandList->Close());    ID3D12CommandList* ppCommandLists[] = { m_commandList.Get() };    m_commandQueue->ExecuteCommandLists(_countof(ppCommandLists), ppCommandLists);    // Create synchronization objects and wait until assets have been uploaded to the GPU.    {        ThrowIfFailed(m_device->CreateFence(m_fenceValues[m_frameIndex], D3D12_FENCE_FLAG_NONE, IID_PPV_ARGS(&m_fence)));        m_fenceValues[m_frameIndex]++;        // Create an event handle to use for frame synchronization.        m_fenceEvent = CreateEvent(nullptr, FALSE, FALSE, nullptr);        if (m_fenceEvent == nullptr)        {            ThrowIfFailed(HRESULT_FROM_WIN32(GetLastError()));        }        // Wait for the command list to execute; we are reusing the same command        // list in our main loop but for now, we just want to wait for setup to        // complete before continuing.        WaitForGpu();    }}
开发者ID:kgawne,项目名称:DirectX-Graphics-Samples,代码行数:88,


示例2: defined

// Load the rendering pipeline dependencies.void D3D12PredicationQueries::LoadPipeline(){#if defined(_DEBUG)	// Enable the D3D12 debug layer.	{		ComPtr<ID3D12Debug> debugController;		if (SUCCEEDED(D3D12GetDebugInterface(IID_PPV_ARGS(&debugController))))		{			debugController->EnableDebugLayer();		}	}#endif	ComPtr<IDXGIFactory4> factory;	ThrowIfFailed(CreateDXGIFactory1(IID_PPV_ARGS(&factory)));	if (m_useWarpDevice)	{		ComPtr<IDXGIAdapter> warpAdapter;		ThrowIfFailed(factory->EnumWarpAdapter(IID_PPV_ARGS(&warpAdapter)));		ThrowIfFailed(D3D12CreateDevice(			warpAdapter.Get(),			D3D_FEATURE_LEVEL_11_0,			IID_PPV_ARGS(&m_device)			));	}	else	{		ComPtr<IDXGIAdapter1> hardwareAdapter;		GetHardwareAdapter(factory.Get(), &hardwareAdapter);		ThrowIfFailed(D3D12CreateDevice(			hardwareAdapter.Get(),			D3D_FEATURE_LEVEL_11_0,			IID_PPV_ARGS(&m_device)			));	}	// Describe and create the command queue.	D3D12_COMMAND_QUEUE_DESC queueDesc = {};	queueDesc.Flags = D3D12_COMMAND_QUEUE_FLAG_NONE;	queueDesc.Type = D3D12_COMMAND_LIST_TYPE_DIRECT;	ThrowIfFailed(m_device->CreateCommandQueue(&queueDesc, IID_PPV_ARGS(&m_commandQueue)));	NAME_D3D12_OBJECT(m_commandQueue);	// Describe and create the swap chain.	DXGI_SWAP_CHAIN_DESC1 swapChainDesc = {};	swapChainDesc.BufferCount = FrameCount;	swapChainDesc.Width = m_width;	swapChainDesc.Height = m_height;	swapChainDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;	swapChainDesc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;	swapChainDesc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_DISCARD;	swapChainDesc.SampleDesc.Count = 1;	ComPtr<IDXGISwapChain1> swapChain;	ThrowIfFailed(factory->CreateSwapChainForCoreWindow(		m_commandQueue.Get(),		// Swap chain needs the queue so that it can force a flush on it.		reinterpret_cast<IUnknown*>(Windows::UI::Core::CoreWindow::GetForCurrentThread()),		&swapChainDesc,		nullptr,		&swapChain		));	ThrowIfFailed(swapChain.As(&m_swapChain));	m_frameIndex = m_swapChain->GetCurrentBackBufferIndex();	// Create descriptor heaps.	{		// Describe and create a render target view (RTV) descriptor heap.		D3D12_DESCRIPTOR_HEAP_DESC rtvHeapDesc = {};		rtvHeapDesc.NumDescriptors = FrameCount;		rtvHeapDesc.Type = D3D12_DESCRIPTOR_HEAP_TYPE_RTV;		rtvHeapDesc.Flags = D3D12_DESCRIPTOR_HEAP_FLAG_NONE;		ThrowIfFailed(m_device->CreateDescriptorHeap(&rtvHeapDesc, IID_PPV_ARGS(&m_rtvHeap)));		// Describe and create a depth stencil view (DSV) descriptor heap.		D3D12_DESCRIPTOR_HEAP_DESC dsvHeapDesc = {};		dsvHeapDesc.NumDescriptors = 1;		dsvHeapDesc.Type = D3D12_DESCRIPTOR_HEAP_TYPE_DSV;		dsvHeapDesc.Flags = D3D12_DESCRIPTOR_HEAP_FLAG_NONE;		ThrowIfFailed(m_device->CreateDescriptorHeap(&dsvHeapDesc, IID_PPV_ARGS(&m_dsvHeap)));		// Describe and create a constant buffer view (CBV) descriptor heap.		D3D12_DESCRIPTOR_HEAP_DESC cbvHeapDesc = {};		cbvHeapDesc.NumDescriptors = CbvCountPerFrame * FrameCount;		cbvHeapDesc.Type = D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV;		cbvHeapDesc.Flags = D3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE;		ThrowIfFailed(m_device->CreateDescriptorHeap(&cbvHeapDesc, IID_PPV_ARGS(&m_cbvHeap)));		NAME_D3D12_OBJECT(m_cbvHeap);		// Describe and create a heap for occlusion queries.		D3D12_QUERY_HEAP_DESC queryHeapDesc = {};		queryHeapDesc.Count = 1;		queryHeapDesc.Type = D3D12_QUERY_HEAP_TYPE_OCCLUSION;		ThrowIfFailed(m_device->CreateQueryHeap(&queryHeapDesc, IID_PPV_ARGS(&m_queryHeap)));//.........这里部分代码省略.........
开发者ID:prabindh,项目名称:DirectX-Graphics-Samples,代码行数:101,


示例3: GetProcAddress

/// <summary>/// Get image .NET runtime version/// </summary>/// <returns>runtime version, "n/a" if nothing found</returns>std::wstring ImageNET::GetImageRuntimeVer( const wchar_t* ImagePath ){    std::wstring LatestVersion = L"n/a";    CComPtr<ICLRMetaHost> MetaHost;        // Check if .NET 4 or higher is present    auto clrCreate = reinterpret_cast<fnCLRCreateInstancen>(        GetProcAddress( LoadLibraryW( L"mscoree.dll" ), "CLRCreateInstance" ));    // Legacy runtime. Get exact required version    if(!clrCreate)    {        wchar_t ver[64] = { 0 };        DWORD bytes = 0;        auto clrGetVer = reinterpret_cast<fnGetRequestedRuntimeVersion>(            GetProcAddress( GetModuleHandleW( L"mscoree.dll" ), "GetRequestedRuntimeVersion" ));        clrGetVer( const_cast<LPWSTR>(ImagePath), ver, 64, &bytes );        FreeLibrary( GetModuleHandleW( L"mscoree.dll" ) );        return ver;    }    // Get highest available    else    {        if (FAILED( clrCreate( CLSID_CLRMetaHost, IID_ICLRMetaHost, reinterpret_cast<LPVOID*>(&MetaHost) ) ))            return LatestVersion;        CComPtr<IEnumUnknown> Runtimes;        if (FAILED( MetaHost->EnumerateInstalledRuntimes( &Runtimes ) ))            return LatestVersion;        CComPtr<IUnknown> Runtime;        CComPtr<ICLRRuntimeInfo> Latest;        while (Runtimes->Next( 1, &Runtime, NULL ) == S_OK)        {            CComPtr<ICLRRuntimeInfo> Current;            wchar_t tmpString[MAX_PATH];            DWORD tmp = MAX_PATH * sizeof(wchar_t);            if (SUCCEEDED( Runtime->QueryInterface( IID_PPV_ARGS( &Current ) ) ))            {                if (!Latest)                {                    if (SUCCEEDED( Current->QueryInterface( IID_PPV_ARGS( &Latest ) ) ))                    {                        Latest->GetVersionString( tmpString, &tmp );                        LatestVersion = tmpString;                    }                }                else                {                    if (SUCCEEDED( Current->GetVersionString( tmpString, &tmp ) ))                    {                        std::wstring CurrentVersion = tmpString;                        if (CurrentVersion.compare( LatestVersion ) > 0)                        {                            LatestVersion = CurrentVersion;                            Latest.Release();                            Current->QueryInterface( IID_PPV_ARGS( &Latest ) );                        }                    }                }            }            Runtime.Release();        }        return LatestVersion;    }    }
开发者ID:shennong,项目名称:Blackbone,代码行数:79,


示例4: WriteContentPropertiesBulk

// Writes a set of properties for all objects.void WriteContentPropertiesBulk(    IPortableDevice*    pDevice){    if (pDevice == NULL)    {        printf("! A NULL IPortableDevice interface pointer was received/n");        return;    }    HRESULT                                       hr                = S_OK;    GUID                                          guidContext       = GUID_NULL;    CSetBulkValuesCallback*                       pCallback         = NULL;    CComPtr<IPortableDeviceProperties>            pProperties;    CComPtr<IPortableDevicePropertiesBulk>        pPropertiesBulk;    CComPtr<IPortableDeviceValues>                pObjectProperties;    CComPtr<IPortableDeviceContent>               pContent;    CComPtr<IPortableDeviceValuesCollection>      pPropertiesToWrite;    CComPtr<IPortableDevicePropVariantCollection> pObjectIDs;    DWORD                                         cObjectIDs        = 0;    // 1) Get an IPortableDeviceContent interface from the IPortableDevice interface to    // access the content-specific methods.    hr = pDevice->Content(&pContent);    if (FAILED(hr))    {        printf("! Failed to get IPortableDeviceContent from IPortableDevice, hr = 0x%lx/n",hr);    }    // 2) Get an IPortableDeviceProperties interface from the IPortableDeviceContent interface    // to access the property-specific methods.    if (SUCCEEDED(hr))    {        hr = pContent->Properties(&pProperties);        if (FAILED(hr))        {            printf("! Failed to get IPortableDeviceProperties from IPortableDevice, hr = 0x%lx/n",hr);        }    }    // 3) Check to see if the driver supports BULK property operations by call QueryInterface    // on the IPortableDeviceProperties interface for IPortableDevicePropertiesBulk    if (SUCCEEDED(hr))    {        hr = pProperties->QueryInterface(IID_PPV_ARGS(&pPropertiesBulk));        if (FAILED(hr))        {            printf("This driver does not support BULK property operations./n");        }    }    // 4) CoCreate an IPortableDeviceValuesCollection interface to hold the the properties    // we wish to write.    if (SUCCEEDED(hr))    {        hr = CoCreateInstance(CLSID_PortableDeviceValuesCollection,                              NULL,                              CLSCTX_INPROC_SERVER,                              IID_PPV_ARGS(&pPropertiesToWrite));        if (FAILED(hr))        {            printf("! Failed to CoCreate IPortableDeviceValuesCollection for bulk property values, hr = 0x%lx/n", hr);        }    }    // 6) Create an instance of the IPortableDevicePropertiesBulkCallback object.    if (SUCCEEDED(hr))    {        pCallback = new (std::nothrow) CSetBulkValuesCallback();        if (pCallback == NULL)        {            hr = E_OUTOFMEMORY;            printf("! Failed to allocate CSetBulkValuesCallback, hr = 0x%lx/n", hr);        }    }    // 7) Call our helper function CreateIPortableDevicePropVariantCollectionWithAllObjectIDs    // to enumerate and create an IPortableDevicePropVariantCollection with the object    // identifiers needed to perform the bulk operation on.    if (SUCCEEDED(hr))    {        hr = CreateIPortableDevicePropVariantCollectionWithAllObjectIDs(pContent,                                                                        &pObjectIDs);    }    if (SUCCEEDED(hr))    {        hr = pObjectIDs->GetCount(&cObjectIDs);        if (FAILED(hr))        {            printf("! Failed to get number of objectIDs from IPortableDevicePropVariantCollection, hr = 0x%lx/n", hr);        }    }    // 8) Iterate through object list and add appropriate IPortableDeviceValues to collection    if (SUCCEEDED(hr))    {        for(DWORD dwIndex = 0; (dwIndex < cObjectIDs) && (hr == S_OK); dwIndex++)        {//.........这里部分代码省略.........
开发者ID:Essjay1,项目名称:Windows-classic-samples,代码行数:101,


示例5: lib

void DirectShowMetaDataControl::updateMetadata(IFilterGraph2 *graph, IBaseFilter *source, const QString &fileSrc){    m_metadata.clear();#ifndef QT_NO_SHELLITEM    if (!sHCreateItemFromParsingName) {        QSystemLibrary lib(QStringLiteral("shell32"));        sHCreateItemFromParsingName = (q_SHCreateItemFromParsingName)(lib.resolve("SHCreateItemFromParsingName"));    }    if (!fileSrc.isEmpty() && sHCreateItemFromParsingName) {        IShellItem2* shellItem = 0;        if (sHCreateItemFromParsingName(reinterpret_cast<const WCHAR*>(fileSrc.utf16()),                                        0, IID_PPV_ARGS(&shellItem)) == S_OK) {            IPropertyStore *pStore = 0;            if (shellItem->GetPropertyStore(GPS_DEFAULT, IID_PPV_ARGS(&pStore)) == S_OK) {                DWORD cProps;                if (SUCCEEDED(pStore->GetCount(&cProps))) {                    for (DWORD i = 0; i < cProps; ++i)                    {                        PROPERTYKEY key;                        PROPVARIANT var;                        PropVariantInit(&var);                        if (FAILED(pStore->GetAt(i, &key)))                            continue;                        if (FAILED(pStore->GetValue(key, &var)))                            continue;                        if (IsEqualPropertyKey(key, PKEY_Author)) {                            m_metadata.insert(QMediaMetaData::Author, convertValue(var));                        } else if (IsEqualPropertyKey(key, PKEY_Title)) {                            m_metadata.insert(QMediaMetaData::Title, convertValue(var));                        } else if (IsEqualPropertyKey(key, PKEY_Media_SubTitle)) {                            m_metadata.insert(QMediaMetaData::SubTitle, convertValue(var));                        } else if (IsEqualPropertyKey(key, PKEY_ParentalRating)) {                            m_metadata.insert(QMediaMetaData::ParentalRating, convertValue(var));                        } else if (IsEqualPropertyKey(key, PKEY_Comment)) {                            m_metadata.insert(QMediaMetaData::Description, convertValue(var));                        } else if (IsEqualPropertyKey(key, PKEY_Copyright)) {                            m_metadata.insert(QMediaMetaData::Copyright, convertValue(var));                        } else if (IsEqualPropertyKey(key, PKEY_Media_ProviderStyle)) {                            m_metadata.insert(QMediaMetaData::Genre, convertValue(var));                        } else if (IsEqualPropertyKey(key, PKEY_Media_Year)) {                            m_metadata.insert(QMediaMetaData::Year, convertValue(var));                        } else if (IsEqualPropertyKey(key, PKEY_Media_DateEncoded)) {                            m_metadata.insert(QMediaMetaData::Date, convertValue(var));                        } else if (IsEqualPropertyKey(key, PKEY_Rating)) {                            m_metadata.insert(QMediaMetaData::UserRating,                                              int((convertValue(var).toUInt() - 1) / qreal(98) * 100));                        } else if (IsEqualPropertyKey(key, PKEY_Keywords)) {                            m_metadata.insert(QMediaMetaData::Keywords, convertValue(var));                        } else if (IsEqualPropertyKey(key, PKEY_Language)) {                            m_metadata.insert(QMediaMetaData::Language, convertValue(var));                        } else if (IsEqualPropertyKey(key, PKEY_Media_Publisher)) {                            m_metadata.insert(QMediaMetaData::Publisher, convertValue(var));                        } else if (IsEqualPropertyKey(key, PKEY_Media_Duration)) {                            m_metadata.insert(QMediaMetaData::Duration,                                              (convertValue(var).toLongLong() + 10000) / 10000);                        } else if (IsEqualPropertyKey(key, PKEY_Audio_EncodingBitrate)) {                            m_metadata.insert(QMediaMetaData::AudioBitRate, convertValue(var));                        } else if (IsEqualPropertyKey(key, PKEY_Media_AverageLevel)) {                            m_metadata.insert(QMediaMetaData::AverageLevel, convertValue(var));                        } else if (IsEqualPropertyKey(key, PKEY_Audio_ChannelCount)) {                            m_metadata.insert(QMediaMetaData::ChannelCount, convertValue(var));                        } else if (IsEqualPropertyKey(key, PKEY_Audio_PeakValue)) {                            m_metadata.insert(QMediaMetaData::PeakValue, convertValue(var));                        } else if (IsEqualPropertyKey(key, PKEY_Audio_SampleRate)) {                            m_metadata.insert(QMediaMetaData::SampleRate, convertValue(var));                        } else if (IsEqualPropertyKey(key, PKEY_Music_AlbumTitle)) {                            m_metadata.insert(QMediaMetaData::AlbumTitle, convertValue(var));                        } else if (IsEqualPropertyKey(key, PKEY_Music_AlbumArtist)) {                            m_metadata.insert(QMediaMetaData::AlbumArtist, convertValue(var));                        } else if (IsEqualPropertyKey(key, PKEY_Music_Artist)) {                            m_metadata.insert(QMediaMetaData::ContributingArtist, convertValue(var));                        } else if (IsEqualPropertyKey(key, PKEY_Music_Composer)) {                            m_metadata.insert(QMediaMetaData::Composer, convertValue(var));                        } else if (IsEqualPropertyKey(key, PKEY_Music_Conductor)) {                            m_metadata.insert(QMediaMetaData::Conductor, convertValue(var));                        } else if (IsEqualPropertyKey(key, PKEY_Music_Lyrics)) {                            m_metadata.insert(QMediaMetaData::Lyrics, convertValue(var));                        } else if (IsEqualPropertyKey(key, PKEY_Music_Mood)) {                            m_metadata.insert(QMediaMetaData::Mood, convertValue(var));                        } else if (IsEqualPropertyKey(key, PKEY_Music_TrackNumber)) {                            m_metadata.insert(QMediaMetaData::TrackNumber, convertValue(var));                        } else if (IsEqualPropertyKey(key, PKEY_Music_Genre)) {                            m_metadata.insert(QMediaMetaData::Genre, convertValue(var));                        } else if (IsEqualPropertyKey(key, PKEY_ThumbnailStream)) {                            m_metadata.insert(QMediaMetaData::ThumbnailImage, convertValue(var));                        } else if (IsEqualPropertyKey(key, PKEY_Video_FrameHeight)) {                            QSize res;                            res.setHeight(convertValue(var).toUInt());                            if (SUCCEEDED(pStore->GetValue(PKEY_Video_FrameWidth, &var)))                                res.setWidth(convertValue(var).toUInt());                            m_metadata.insert(QMediaMetaData::Resolution, res);                        } else if (IsEqualPropertyKey(key, PKEY_Video_HorizontalAspectRatio)) {                            QSize aspectRatio;                            aspectRatio.setWidth(convertValue(var).toUInt());                            if (SUCCEEDED(pStore->GetValue(PKEY_Video_VerticalAspectRatio, &var)))                                aspectRatio.setHeight(convertValue(var).toUInt());//.........这里部分代码省略.........
开发者ID:2gis,项目名称:2gisqt5android,代码行数:101,


示例6: GetObjectIdentifierFromPersistentUniqueIdentifier

// Retreives the object identifier for the persistent unique identifervoid GetObjectIdentifierFromPersistentUniqueIdentifier(    IPortableDevice* pDevice){    if (pDevice == NULL)    {        printf("! A NULL IPortableDevice interface pointer was received/n");        return;    }    HRESULT                                         hr                  = S_OK;    WCHAR                                           szSelection[81]     = {0};    CComPtr<IPortableDeviceContent>                 pContent;    CComPtr<IPortableDevicePropVariantCollection>   pPersistentUniqueIDs;    CComPtr<IPortableDevicePropVariantCollection>   pObjectIDs;	//<SnippetContentProp7>    // Prompt user to enter an unique identifier to convert to an object idenifier.    printf("Enter the Persistant Unique Identifier of the object you wish to convert into an object identifier./n>");    hr = StringCbGetsW(szSelection,sizeof(szSelection));    if (FAILED(hr))    {        printf("An invalid persistent object identifier was specified, aborting the query operation/n");    }	//</SnippetContentProp7>    // 1) Get an IPortableDeviceContent interface from the IPortableDevice interface to    // access the content-specific methods.	//<SnippetContentProp8>    if (SUCCEEDED(hr))    {        hr = pDevice->Content(&pContent);        if (FAILED(hr))        {            printf("! Failed to get IPortableDeviceContent from IPortableDevice, hr = 0x%lx/n",hr);        }    }	//</SnippetContentProp8>    // 2) CoCreate an IPortableDevicePropVariantCollection interface to hold the the Unique Identifiers    // to query for Object Identifiers.    //    // NOTE: This is a collection interface so more than 1 identifier can be requested at a time.    //       This sample only requests a single unique identifier.	//<SnippetContentProp9>    hr = CoCreateInstance(CLSID_PortableDevicePropVariantCollection,                          NULL,                          CLSCTX_INPROC_SERVER,                          IID_PPV_ARGS(&pPersistentUniqueIDs));	//</SnippetContentProp9>	//<SnippetContentProp10>    if (SUCCEEDED(hr))    {        if (pPersistentUniqueIDs != NULL)        {            PROPVARIANT pv = {0};            PropVariantInit(&pv);            // Initialize a PROPVARIANT structure with the object identifier string            // that the user selected above. Notice we are allocating memory for the            // PWSTR value.  This memory will be freed when PropVariantClear() is            // called below.            pv.vt      = VT_LPWSTR;            pv.pwszVal = AtlAllocTaskWideString(szSelection);            if (pv.pwszVal != NULL)            {                // Add the object identifier to the objects-to-delete list                // (We are only deleting 1 in this example)                hr = pPersistentUniqueIDs->Add(&pv);                if (SUCCEEDED(hr))                {                    // 3) Attempt to get the unique idenifier for the object from the device                    hr = pContent->GetObjectIDsFromPersistentUniqueIDs(pPersistentUniqueIDs,                                                                       &pObjectIDs);                    if (SUCCEEDED(hr))                    {                        PROPVARIANT pvId = {0};                        hr = pObjectIDs->GetAt(0, &pvId);                        if (SUCCEEDED(hr))                        {                            printf("The persistent unique identifier '%ws' relates to object identifier '%ws' on the device./n", szSelection, pvId.pwszVal);                        }                        else                        {                            printf("! Failed to get the object identifier for '%ws' from the IPortableDevicePropVariantCollection, hr = 0x%lx/n",szSelection, hr);                        }                        // Free the returned allocated string from the GetAt() call                        PropVariantClear(&pvId);                    }                    else                    {                        printf("! Failed to get the object identifier from persistent object idenifier '%ws', hr = 0x%lx/n",szSelection, hr);                    }                }                else                {                    printf("! Failed to get the object identifier from persistent object idenifier because we could no add the persistent object identifier string to the IPortableDevicePropVariantCollection, hr = 0x%lx/n",hr);                }            }            else            {//.........这里部分代码省略.........
开发者ID:Essjay1,项目名称:Windows-classic-samples,代码行数:101,


示例7: CFileDialog

CSaveThumbnailsDialog::CSaveThumbnailsDialog(    int rows, int cols, int width, int quality, int levelPNG,    LPCTSTR lpszDefExt, LPCTSTR lpszFileName,    LPCTSTR lpszFilter, CWnd* pParentWnd) :    CFileDialog(FALSE, lpszDefExt, lpszFileName,                OFN_EXPLORER|OFN_ENABLESIZING|OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT|OFN_PATHMUSTEXIST|OFN_NOCHANGEDIR,                lpszFilter, pParentWnd)    , m_rows(rows)    , m_cols(cols)    , m_width(width)    , m_quality(quality)    , m_levelPNG(levelPNG){    if (IsWinVistaOrLater()) {        IFileDialogCustomize* pfdc = GetIFileDialogCustomize();        if (pfdc) {            // Create an event handling object, and hook it up to the dialog.            IFileDialogEvents *pfde = NULL;            HRESULT hr = _CDialogEventHandler_CreateInstance(IID_PPV_ARGS(&pfde));            if (SUCCEEDED(hr)) {                // Hook up the event handler.                DWORD dwCookie;                hr = GetIFileSaveDialog()->Advise(pfde, &dwCookie);                if (SUCCEEDED(hr)) {                    ;                }            }            CString str;            pfdc->StartVisualGroup(IDS_THUMB_THUMBNAILS, ResStr(IDS_THUMB_THUMBNAILS));            pfdc->AddText(IDS_THUMB_ROWNUMBER, ResStr(IDS_THUMB_ROWNUMBER));            str.Format(L"%d", max(1, min(20, m_rows)));            pfdc->AddEditBox(IDC_EDIT1, str);            pfdc->AddText(IDS_THUMB_COLNUMBER, ResStr(IDS_THUMB_COLNUMBER));            str.Format(L"%d", max(1, min(10, m_cols)));            pfdc->AddEditBox(IDC_EDIT2, str);            pfdc->EndVisualGroup();            pfdc->StartVisualGroup(IDS_THUMB_IMAGE_WIDTH, ResStr(IDS_THUMB_IMAGE_WIDTH));            pfdc->AddText(IDS_THUMB_PIXELS, ResStr(IDS_THUMB_PIXELS));            str.Format(L"%d", max(256, min(2560, m_width)));            pfdc->AddEditBox(IDC_EDIT3, str);            pfdc->EndVisualGroup();            pfdc->StartVisualGroup(IDS_THUMB_IMAGE_QUALITY, ResStr(IDS_THUMB_IMAGE_QUALITY));            pfdc->AddText(IDS_THUMB_QUALITY, ResStr(IDS_THUMB_QUALITY));            str.Format(L"%d", max(70, min(100, m_quality)));            pfdc->AddEditBox(IDC_EDIT4, str);            pfdc->AddText(IDS_THUMB_LEVEL, ResStr(IDS_THUMB_LEVEL));            str.Format(L"%d", max(1, min(9, m_levelPNG)));            pfdc->AddEditBox(IDC_EDIT5, str);            pfdc->EndVisualGroup();            pfdc->Release();        }    } else {        SetTemplate(0, IDD_SAVETHUMBSDIALOGTEMPL);    }}
开发者ID:Tphive,项目名称:mpc-be,代码行数:64,


示例8: CoCreateInstance

bool ResourceManager::LoadFile(ID2D1HwndRenderTarget* renderTarget, wchar_t * filename){	HRESULT result;	IWICImagingFactory2* wicFactory;	IWICBitmapDecoder* wicDecoder;	IWICBitmapFrameDecode* wicFrame;	IWICBitmapFlipRotator* wicFlip;	IWICFormatConverter *wicConverter;	Sprite*	newSprite;	// WIC
C++ IL64函数代码示例
C++ IID_PPV_ARG函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。