Recent

Author Topic: Tangled up with ActiveX  (Read 2538 times)

RedOctober

  • Sr. Member
  • ****
  • Posts: 452
Tangled up with ActiveX
« on: August 25, 2021, 06:27:35 pm »
Platform:  Lazarus 2.0.10 FPC 3.2.0, Windows Server 2016

Problem 1:  I can see in my Package -> Install/Uninstall on the Left hand side, "Installed" list (labeled "Install" at the top),  I can see LazActiveX 0.1 is listed.  However, there is no ActiveX tab in my IDE, and there is no ActiveX component on any other tab (that I can see).  Is there something I need to do to make the ActiveX tab visible in my IDE?   Without this ActiveX tab and ActiveXContainer visual component, I have to create ActiveXContainer1 object in source code.

Problem 2:  I'm working with an existing project, in the platform described above (with no ActiveX tab) that uses ActiveX.  I can open the project, compile it, and it runs correctly.  In the source code there is an ActiveX component being created.  It's for QuickPDF;  The source is:

Code: Pascal  [Select][+][-]
  1. uses ...   activexcontainer, DebenuPDFLibrary64AX1013_10_13_TLB, ...
  2.  
  3. private
  4.     qpdfDCL: TAxcPDFLibrary;
  5.  
  6. FormCreate...
  7.  
  8.   GV.QwkPdf.axl := qpdfDCL;
  9.   with GV.QwkPdf.axl.OleServer do
  10.     begin
  11.       ... do stuff ... all works ...
  12.     end;
  13.  
  14.  

QuickPDF all works correctly.  Now I have to incorporate an ActiveX component for Internet Explorer.  I'm following the instructions here:

https://wiki.freepascal.org/LazActiveX

and the example I am trying to follow is:
"Example: Internet Explorer in a form with event support."

I need to import ieframe.dll according to the instructions.  I use Tools/ Import type Library, (then I don't know which tab to use, Visual Controls, or ActiveX References, so I chose ActiveX References).

This creates a unit file called SHDocVw_1_1_TLB.pas.  However, my project already contains a unit by the same name, probably due to the QuickPDF ActiveX component being used elsewhere in the project.  Now, when I try to save the project, I get a dialog that pops up, asking me if I want to force renaming.  I'm reluctant to say "yes" because I have no idea if that is going to wreck my project and stop QuickPDF from working.

Questions Summary:

How can I get my ActiveX tab to appear in my Lazarus IDE?

What is the proper way to import ieframe.dll and not have to force the renaming of the existing file:  SHDocVw_1_1_TLB.pas

I need to import ieframe.dll because I need the IEBrowser.ComServer.Navigate2 method in the TEvsWebBrowser type, and does not exist in the TAxcWebBrowser type.

Thanks in advance for any help you can provide.



RedOctober

  • Sr. Member
  • ****
  • Posts: 452
Re: Tangled up with ActiveX
« Reply #1 on: August 26, 2021, 12:24:22 am »
Hi Jamie, I did the clean and build, but no ActiveX tab appears.  Still missing.

RedOctober

  • Sr. Member
  • ****
  • Posts: 452
Re: Tangled up with ActiveX
« Reply #2 on: August 26, 2021, 03:15:21 am »
Hi Jamie.  I uninstalled and reinstalled the LazActiveX.  My IDE now has an ActiveX tab in it, with TActiveXContainer and TAxcPDFLibrary.  You have solved Problem 1.

Please see attached .Pdf file for screen captures of the problem 2 described above.

RedOctober

  • Sr. Member
  • ****
  • Posts: 452
Re: Tangled up with ActiveX
« Reply #3 on: August 26, 2021, 03:19:15 am »
I don't know if this is the correct way to do this, but I renamed the file to:

shdocvw_1_1_tlb_ieframe.pas

just before saving.  This got me past the "Force renaming" problem, but I see I don't have an additional ActiveX component for the IEFrame. I'm not sure if I'm supposed to see one or not.  I checked the box saying I want a component.

I continued on with trying to follow the instructions in the mentioned URL.  I included the files activexcontainer, and shdocvw_1_1_tlb_ieframe in the uses clause.  At the line:

Code: Pascal  [Select][+][-]
  1.  
  2. private
  3.     ActiveXContainer1: TActiveXContainer;
  4.     Browser: TEvsWebBrowser;   <--- here
  5.  

The compiler complains with:

TEvsWebBrowser Identifier not found.

Any ideas what I have done wrong?
« Last Edit: August 26, 2021, 03:27:42 am by RedOctober »

RedOctober

  • Sr. Member
  • ****
  • Posts: 452
Re: Tangled up with ActiveX
« Reply #4 on: August 27, 2021, 01:11:24 am »
It seems that in the file:

Unit SHDocVw_1_1_TLB;

//  Imported SHDocVw on 2020-Jun-22 12:00:07 from C:\Windows\System32\ieframe.dll

on the Windows Server 2016 platform, there is no longer a type:  TEvsWebBrowser;

I have to abandon this approach.

 

TinyPortal © 2005-2018