-2

I have the below VBA code from a vendor website. I managed to import the TLB libraries into a Delphi project and made references to the corresponding unit files. However, I'm struggling to convert the below VBA specific object declaration to Delphi. How do I do this?

Dim app As Attachmate_Reflection_Objects_Framework.ApplicationObject
Dim terminal As Attachmate_Reflection_Objects_Emulation_IbmHosts.ibmTerminal
Dim view As Attachmate_Reflection_Objects.view
Dim frame As Attachmate_Reflection_Objects.frame
          
Set app = GetObject("Reflection Workspace")
      
'Get handles to the frame, view, and terminal objects
Set frame = app.GetObject("Frame")

Set view = frame.SelectedView
Set terminal = view.Control
Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
jimsweb
  • 1,082
  • 2
  • 17
  • 37
  • 3
    Reading the IDE-generated .pas file created from the TLB will give you the corresponding Delphi types. If you do that reading, it should allow you to at least make an effort to convert the code yourself. Do that, and if you run into difficulties you can ask for help with a specific problem. – Ken White Nov 26 '21 at 21:26

1 Answers1

1

At the end of the Generated Typelibrary is normally a Section with Co Classes. This are the ones you can Use the replace the

Set app = GetObject("Reflection Workspace")

with something like:

MyDelphiComClass := CoReflection_Workspace.Create;

i did not read it, but this seems to have some knowledge in it:Building a COM Client Application

At a first glance it looks somewhat complete.