Results 1 to 2 of 2

Thread: Obscure Newbie question

  1. #1
    KWeston
    Guest

    Question Obscure Newbie question



    I've been writing little frontend programs to expidite working on an old mainframe system via IBM's PCOMM system. In general, I simply stick to the template PCOMM's help provides for how to control it, i.e.:

    sub Do_Something()
    Dim SessionOne As Object
    Set SessionOne = CreateObject("PCOMM.autECLPS")
    SessionOne.SetConnectionByName ("A")
    StuffToGet= SessionOne.GetText(1, 1, 4)
    Set SessionOne = Nothing
    end sub

    (The above picks the first PCOMM Session (session A), grabs 4 characters frm x=1,y=1, and calls them StuffToGet)

    I notice, however, after I run the program (or, rather, a version of it that actually DOES stuff, unlike the above) 20 or so times, I start to see a substantial slowdown on my machine.

    I use:
    Dim Form As Form
    For Each Form In Forms
    Unload Form
    Set Form = Nothing
    Next Form
    at the end of the code to unload the form, as well as setting each created connection = Nothing (as in the first code sample, above), yet I still see this performance problem.

    Ok, I admit.. I'm still new to this kind of thing, but am I missing something basic here? Or is there something specific I should be looking for that would cause such probs. (E.g., do I need to actually kill each temporary variable I use all through the program, etc.)

    Thanks!

  2. #2
    jim mcnamara
    Guest
    If your code is like what you're showing as a sample, it probably is not your fault. Some COM objects have memory leaks, and it looks like PCOMM may be one of them.

    Also, be sure that when your run your code in the IDE that you don't terminate the code early, using 'END' from the RUN menu. Let the code finish. Be sure to unload everything even when your code abends.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width