title: Using COM object from PowerBuilder - error 36: name not found accessing external object
body: <p>I'm trying to access a third-party COM server from within Powerbuilder. I can instantiate the object but whenever I try to call a method or a property on the object I get error 36: "name not found accessing external object".</p>
  
  <pre><code>OLEObject PNSession
  PNSession = CREATE OLEObject
  ll_status = PNSession.ConnectToNewObject("PNSrv9.PNSession")
  if ll_status = 0 then
      // Set the session printer
      try
         PNSession.SetSessionPrinter('TIFF Image Printer 9.0', 1, g_pfapp.null_string, False)
      catch (oleruntimeerror lole_error2)
          messagebox('Set Error', lole_error2.description)
      end try
  
      // Turn job tracking on
      PNSession.TrackingOn = True
  end if
  </code></pre>
  
  <p>The ConnectToNewObject call succeeds and I see the COM server in my Task Manager, but subsequent calls fail. The above looks correct based on all the COM automation code samples for Word, Excel that I looked at.</p>
  
  <p>The COM server is a C++ ATL COM Server, not a .NET COM object if that makes any difference.</p>
  
  <p>Does anyone have an idea why this isn't working or what I am missing?</p>
  
  <p>Thanks.</p>