Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Tuesday, December 22, 2009 4:32:27 AM(UTC)
amenveil

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

 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Wednesday, December 23, 2009 4:38:29 AM(UTC)

Basel  
Guest

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

 
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.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.062 seconds.