i've to show a file preview in a mfc program.
Code: Select all
if(IsGdPictureRegistered())
{
_GdViewer** pEditor;
CAxWindow GdViewer;
GdPictureStatus status;
GdViewer.Attach(hWnd); // hWnd = GetDlgItem(IDC_GDVIEWER);
HRESULT hr=GdViewer.QueryControl(&pEditor);
if (SUCCEEDED(hr))
{
if(GdPictureViewer_CreateObject(pEditor) == S_OK)
status = (*pEditor)->DisplayFromFile("C:\\Users\\pippo.pdf");
}
}
It failed always the QueryControl.
I don't know if i use the correct way to bind the control with the gdViewer.
thank's in advance
Davide