Rocket Software Homepage
Forum Home Forum Home > AccuTerm Knowledge Base (read only) > Scripting & Automation
  New Posts New Posts RSS Feed - Writetext method
  FAQ FAQ  Forum Search   Register Register  Login Login

The AccuTerm forum has moved. Go to community.rocketsoftware.com to register for the new Rocket forum.

Forum LockedWritetext method

 Post Reply Post Reply
Author
Message
esawyer View Drop Down
Newbie
Newbie


Joined: June 05 2017
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote esawyer Quote  Post ReplyReply Direct Link To This Post Topic: Writetext method
    Posted: June 05 2017 at 3:25pm
I am trying to get a program to write text to the currently open Accuterm2k2 session. I am using VS2017, VB.net. I have added the .tlb to my program properties, I am able to access the Session properties. My issue is when I try to run the GetObject. I am getting a "Class not registered" exception. I know I am missing something really simple.
 

'*** test accuterm code

Dim obj As New AccuTermClasses.Session

obj = GetObject("atwin32.accuterm")

obj.WriteText("10")

Thank you in advance for any help.

Erick

 

 

 

Back to Top
PSchellenbach View Drop Down
Admin Group
Admin Group

Moderator

Joined: December 15 2003
Location: United States
Status: Offline
Points: 2150
Post Options Post Options   Thanks (0) Thanks(0)   Quote PSchellenbach Quote  Post ReplyReply Direct Link To This Post Posted: June 06 2017 at 7:53am
Hi Erick -

Try something like:

Dim appObj as atwin32.AccuTerm
Dim sesObj as Session
appObj = CreateObject("atwin32.AccuTerm")
sesObj = appObj.Sessions.Add("c:\myfiles\mycfg.atcf")

I know the CreateObject syntax is wrong for .NET, but you should be able to google the correct syntax. This if you want your .NET app to create a new instance of AccuTerm. Use GetObject() if you want to get a reference to an existing instance of AccuTerm. In that case use sesObj = appObj.ActiveSession instead of Sessions.Add.

Hope this helps.

Thanks,

Pete

Back to Top
esawyer View Drop Down
Newbie
Newbie


Joined: June 05 2017
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote esawyer Quote  Post ReplyReply Direct Link To This Post Posted: June 06 2017 at 8:03am
I'm just trying to send strings to the active window. We are currently running 2K2. Not sure if that changes anything.
 
When I'm trying the auto-fill for references, I'm getting the Atwin2K2 object and not the atwin32 object.
 
If I just leave that as Accuterm, then I am unable to get the sesObj as ActiveSession, just Session.
 
Thank you for the help.
Back to Top
esawyer View Drop Down
Newbie
Newbie


Joined: June 05 2017
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote esawyer Quote  Post ReplyReply Direct Link To This Post Posted: June 06 2017 at 10:25am
I have managed to get this working. I updated to Accuterm7(which is the same level as the rest of the office), added the new reference and everything now works.
 
Thank you again for the help.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.03
Copyright ©2001-2019 Web Wiz Ltd.