0

ボタンクリックで表示しようとしています。私はコードを書きましたが、それが正しいと確信しています。

デバッグ時に、WICPixelFormatGUID = {????????-????-????-????-????????????} および guidPixelFormatSource = の値を取得します{CCCCCCCC-CCCC-CCCC-CCCC-CCCCCCCCCCCC}。なぜこれらの奇妙な値を取得するのかわかりませんか??

私のコードは次のとおりです-

   HRESULT AMEPreviewHandler::ConvertBitmapSourceTo32bppHBITMAP(
        IWICBitmapSource * pBitmapSource, 
        IWICImagingFactory * pImagingFactory, 
        HBITMAP * pStream)
//Pay Attention that this function is called from a static function by creating instance of the class (there is no problem in the function call . I have checked the value of the parameters while debugging   and i am sure that its correct)
    {
        IWICBitmapSource *pBitmapSourceConverted = NULL;
        WICPixelFormatGUID guidPixelFormatSource; /the problem here is here on debugging it gives strange value.
        HRESULT hr = pBitmapSource->GetPixelFormat(&guidPixelFormatSource);
        if (SUCCEEDED(hr) && (guidPixelFormatSource != GUID_WICPixelFormat32bppBGRA))
        {
            IWICFormatConverter *pFormatConverter;
            hr = pImagingFactory->CreateFormatConverter(&pFormatConverter);
            if (SUCCEEDED(hr))
            {
                             .......And so on....
            }
        }
    }

もう1つのことは、非静的関数から同じコードを実行すると正常に動作することです(しかし、私の状況では、ボタンクリックイベントで呼び出す必要があり、DialogProc()関数によって行われます(静的関数です)。もうオプションが残っていないので、クラスのインスタンスを作成し、それらのインスタンスとポインターを使用して、この ConvertBitmapSourceTo32bppHBITMAP を呼び出しています (コンストラクターで初期化されたインスタンスを使用してパラメーターを渡すことにより)。

2つのデバッグに関する奇妙な値の理由???

4

0 に答える 0