Page 1 of 1

GdViewer and COM

Posted: Tue Sep 18, 2012 12:41 pm
by DavideBak
Hello,
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");
		}
	}
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

Re: GdViewer and COM

Posted: Fri Apr 12, 2019 2:36 pm
by Gabriela
Hi,

pretty old thread :) but here is our tutorial for COM edition:
https://www.gdpicture.com/guides/gdpicture/web ... iveX).html