This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

COM automation of EXTRA! from dotnet core C# using VS Code

I am trying to convert a C# WPF application (that automates Extra! via the COM interface of Extra!) to a dotnet core application built with the Microsoft Visual Studio Code IDE. The application currently works fine when built as a WPF .net Framework application using Visual Studio Pro (or Visual Studio Community edition).

When using VS Code to compile the same code as a dotnet CORE program, I've run into the issue of how to properly add a reference to the EXTRA! object library so that the 'using EXTRA;' statement in my C# code can find the library. I'm new to the dotnet core world and have not yet found the right way to add the reference. From my searching, I suspect I may need to run the tlbimp utility to convert the extra.tlb file to an extra.dll and then (maybe) use a <Reference Include=...> block to my .csproj file. I also suspect I might need a using statement referring to an Interop assembly.  So far, my efforts to take those actions have not worked.

I am beginning to wonder if it is possible to build a dotnet core C# WPF application in VS Code running on Windows 10, that automates Extra! X-treme at the version level 9.3.2683.0 running on a Windows 10 OS.  I have not yet succeeded at figuring out how it might be possible. Any assistance to shorten my quest would be gratefully accepted.

The successful Visual Studio project that works (and needs conversion/porting to work as dotnet core in VS Code) is setup as follows:

It is a WPF App .net Framework project (not a .net CORE project)

The project References needed an 'add reference' to the extra.tlb from the EXTRA! program folder.

These lines were added to the .cs program file:

using EXTRA;

ExtraSystem XtraSystem;
ExtraSessions XtraSessions;
ExtraSession XtraSession;
ExtraScreen XtraScreen;

XtraSystem = (ExtraSystem)Activator.CreateInstance(Type.GetTypeFromProgID("EXTRA.System"));
XtraSessions = (ExtraSessions) XtraSystem.Sessions;
XtraSession = XtraSystem.Sessions("MAINFRAME DEMO SESSION");

XtraScreen = XtraSession.Screen;
string x = XtraScreen.GetString(2, 1, 60);
XtraScreen.SendKeys("Hello");

Thanks for any help you can give.

Tags:

Labels:

Mainframe Access
Parents
  • Hello Jim S,

    Your question is a bit over my head, but I wanted to at least offer you some documentation that could help you answer your question.  Have a look at https://support.microfocus.com/kb/doc.php?id=7021278#API_Reference_Manuals

    I also want to make note that the version of Extra that you mention in your post (9.3) is not supported in Windows 10.  While I don't think the version has anything to do with your issue here, it is recommended that you upgrade to 9.5 to better support Windows 10 clients.

    You have posted your question in the right place for community discussions, but if you find you need technical support, you can contact our support organization 800-688-3270.

    Best Regards,

    Jeff

Reply
  • Hello Jim S,

    Your question is a bit over my head, but I wanted to at least offer you some documentation that could help you answer your question.  Have a look at https://support.microfocus.com/kb/doc.php?id=7021278#API_Reference_Manuals

    I also want to make note that the version of Extra that you mention in your post (9.3) is not supported in Windows 10.  While I don't think the version has anything to do with your issue here, it is recommended that you upgrade to 9.5 to better support Windows 10 clients.

    You have posted your question in the right place for community discussions, but if you find you need technical support, you can contact our support organization 800-688-3270.

    Best Regards,

    Jeff

Children
  • Hi Jeff
    Thank you for your reply. I gave the information at that link a good read. I do wish I could be running the latest version, but that is out of my hands.
    I'll wait a while to see what the community might know before moving on to the support organization. I also haven't yet given up on figuring it out myself.
    Thanks again.
    Jim