LEADTOOLS Support
General
General Questions
LeadTools ActiveX 16.5 and Visual C++ 9.0
This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Tuesday, December 22, 2009 4:32:27 AM(UTC)
Groups: Registered
Posts: 1
Hi,
I'm getting started with LeadTools Active-X Eval 16.5 and I tried to follow steps from "Using the Main ActiveX Control in VC++ .NET" in Visual C++ 9.0:
1. Create MFC Application that is dialog-based and uses MFC in a shared dll. Name a project "Tutor".
2. 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.
3. Right click the control on the dialog
and select “Add Variable…” Name the variable “m_Lead1” and click okay.
4. 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") // here I had to put full path to LTOCXU.ocx
5. Open the *.h file TutorDlg.h. Add the public variable: _DLeadPtr m_pLead1;
6. 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);
7. Compile and run your code. You should see an image when the dialog appears. - And here I've got error C4430: missing type specifier - int assumed for string _DLeadPtr m_pLead1.
Could you tell what I did wrong? All demo projects from \Examples\OCX\MSVC\ work perfectly and the problem is only for a new project.
Thanks in advance
#2
Posted
:
Wednesday, December 23, 2009 4:38:29 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
It seems the help topic was not updated to VS2005 and VS2008. I have informed our documentation team to update it.
You can use the following steps to get it to work:
1. Open VS.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".
2. 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 OK.
3. Right click the control on the dialog and select "Add Variable…" Name the variable "m_Lead1" and click Finish.
4. Open the header file "stdafx.h" and somewhere before the end of the file add the following line of code:
#import "LTOCXU.ocx" no_namespace, named_guids, exclude("ReadyStateConstants")
5. Open the *.cpp file TutorDlg.cpp. In OnInitDialog, below the CDialog::OnInitDialog(); call add the code:
m_Lead1.Load(TEXT("D:\\TestFolder\\11.jpg"), 0, 0, 1);
6. Compile and run your code. You should see an image when the dialog appears.
7. In this code you will use the m_Lead1 variable when calling any property or method. Follow the same procedure to add other controls to the form
LEADTOOLS Support
General
General Questions
LeadTools ActiveX 16.5 and Visual C++ 9.0
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.