GdViewer and COM
Posted: Tue Sep 18, 2012 12:41 pm
Hello,
i've to show a file preview in a mfc program.
this code is call into InitDialog from a dialog with a gdviewer control.
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
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