-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
1
  • 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. Commented Nov 26, 2021 at 21:26

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.