Available in the LEADTOOLS Imaging toolkit. |
Using the Main ActiveX Control in VC++ .NET
Open .NET and create a new Visual C++ MFC Application that is Dialog Based and uses MFC in a shared DLL. Take the defaults for everything else. Name the project “Tutor”
Once the main dialog appears, right click the dialog and select “Insert ActiveX control…” From the list of ActiveX Controls select “LEAD Main Control” and click okay.
Right click the control on the dialog and select “Add Variable…” Name the variable “m_Lead1” and click okay.
Open the header file “stdafx.h” and at the end of the file add the following line of code:
#import "LTOCXU.ocx" no_namespace, named_guids, exclude("ReadyStateConstants")
Open the *.h file TutorDlg.h. Add the public variable: _DLeadPtr m_pLead1;
Open the *.cpp file TutorDlg.cpp. In OnInitDialog add the code:
m_pLead1 = m_Lead1.GetControlUnknown();
m_pLead1->Load(“D:\\Test\\Test.jpg”, 0, 0, 1);
Compile and run your code. You should see an image when the dialog appears.
In this code you will use the m_pLead1 variable when calling any property or method. Follow the same procedure to add other controls to the form.