IBM PCOMM Emulator - Code runs in VBA but not in VB RRS feed

  • Question

  • Hi,
    I am writing code for IBM PCOMM Emulator v 5.9.
    It supports programming in, VBScripting, C++, Java. They have not mentioned about VBA and pure VB specifically. But still I could write code in VBA and run it.
    But when I try to run same code in Visual Studio 2008 as Visual Basic Windows Console program, I get error:
    "retrieving the COM class factory for component with CLSID failed due to following error."

    details: A cross-reference link in the body of a topic is broken. Information not found

    But I am adding necessary PCOMM libraries in add reference.

    When I add same reference in VBA and write a code which runs, I try to mimic same procedure in VB program, but it fails.


    Global objWin As New AutOIA
    Global objKey As New AutPS
    Sub subMain()
    strId = UCase(InputBox("Select Emulator session", "PCOMM Selection", "A"))
    objWin.SetConnectionByName strId
    objKey.SetConnectionByName strId
    Set objWin = Nothing
    Set objKey = Nothing
    End Sub

    The first error occurs at first line saying wrong syntax (Global can't be used.)

    The second error occurs, if i try to use Set keyword to create a object.

    Below is actual VB code

    Module Module1
        Global objWin as New AutOIATypeLibrary.Autps
        Global objKey as New AutPSTypeLibrary.Autoia
        Sub Main()
            Dim objWin As Object
            Dim objKey As Object
            Dim strId As String
            strId = "A"
            MsgBox("Done and now terminating.")
            objWin = Nothing
            objKey = Nothing
        End Sub
    End Module

    Thanks for your time.



    • Moved by Youen Zen Monday, July 29, 2013 7:03 AM
    Tuesday, July 16, 2013 3:24 PM


All replies

  • Hi Ajay,

    I'd suggest get consult these libraries' provider for support.


    Shanks Zen
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Proposed as answer by Just Karl Tuesday, January 7, 2014 10:00 PM
    • Marked as answer by Just Karl Sunday, January 26, 2014 2:28 AM
    Thursday, July 18, 2013 7:41 AM
  • Hi, Shanks Zen.

    Thanks for suggestion. I am doing that too. But found their documentation is bit tricky. What I read online, from that it seems Visual Basic can be used to do this job, but IBM's official documentation no where mentions it. They say it can work with VB Engine and I have personally tested it using VBScript and VBA. This works in both former cases, but not in VB case. So I thought I might be doing something wrong (which may hold true).

    Also, I am searching for their official forum, but again no success in that too.

    Would update this place soon, as my other colleagues are also working on it.


    • Proposed as answer by kilvroch1 Tuesday, January 7, 2014 3:58 PM
    • Unproposed as answer by kilvroch1 Tuesday, January 7, 2014 3:58 PM
    Saturday, July 20, 2013 11:02 PM
  • Have you tried out the sample application provided by IBM? 

    On my machine, they were installed in C:\Program Files (x86)\IBM\Personal Communications\Samples\eclsamp.net

    Tuesday, January 7, 2014 4:04 PM