by Cosmo » Tue Jul 14, 2009 5:59 am
OK, I stumbled upon how to do it. Even a blind squirrel finds a nut every now and then.
Create the MDI project using the MFC APPWIZARD as per usual. In step 3 of 6 select ActivX Controls support. Click thru to finish. Goto Project/Add To Project/Components and Controls.../Registered ActiveX Controls and add the GdPicture4.Imaging.lnk control. This creates the MFC wrapper class for the control which then appears in the IDE class view box.
Look in the MSDN Library Visual Studio 6.0/Visual C__ Documentation/Using Visual C++/Visual C++ Programmer's Guide/Adding User Interface Features/Details/ActiveX Control Containers/ActiveX Control Containers: Using Controls in a Non-Dialog Container and follow the instructions there. They tell you to use the wrapper class' Create member function to create the control. Insert the wrapper class header in the MFC view class header file just before the view class definition. Add a member variable of the wrapper class type to the class definition. Add a WM_CREATE message handler to the MFC view class using the class wizard. (Be sure to find the WM_CREATE message in the class wizard.) Add the create command as m_myCtl.Create(NULL,WS_VISIBLE,CRect(50,50,100,100),this,0);. Follow this with the m_myCtl.SetLicenseNumber("000000..."); And I'm off and running.
Everything seems to work OK and the DisplayImageOnHDC(long(pDC->GetSAfeHdc()),0,0,400,400,3); command works OK to display the image in by MDI window.
So, no reply necessary.
Cosmo