This is very strange to me, but this code was working previously, now is failing for unknown reasons.

Both eventQ and newFoo are valid objects, yet the return code off of GetProxyForObject is failing. Can anyone see why this would be the case? This is a rather urgent matter. Thanks for any help!

Regards,
William Buch

  nsTestXPCFoo *newFoo = new nsTestXPCFoo(this);
  nsresult rv;

  // Get the current event queue
  if (gServiceManager)
  {

gServiceManager->GetServiceByContractID("@mozilla.org/event-queue-service;1",
        NS_GET_IID(nsIEventQueueService), (void**)&nsEventQueueService);
    if (nsEventQueueService)
    {
      nsEventQueueService->GetThreadEventQueue (NS_CURRENT_THREAD,
                 &eventQueue);
    }
  }

nsISample *serviceObject = nsnull;

  if (gServiceManager)
  {
     rv = gServiceManager->GetServiceByContractID("@mozilla.org/sample;1",
        NS_GET_IID(nsISample), (void **)&serviceObject);
     printf("Service Object Result: %i\n", rv);
  }

// Create the Proxy
if (gServiceManager)
{
rv = gServiceManager->GetServiceByContractID("@mozilla.org/xpcomproxy;1",
NS_GET_IID(nsIProxyObjectManager), (void **)&nsProxyObjectManager);
printf("Proxy Object Manager Result: %i\n", rv);
if (nsProxyObjectManager)
{
printf("Event %x\n", eventQueue);
printf("New Foo %x\n", newFoo);
rv = nsProxyObjectManager->GetProxyForObject (eventQueue,
NS_GET_IID(nsITestProxy),
newFoo,
PROXY_ALWAYS,
(void **)&proxyObject);
printf("%i\n", rv);
NS_RELEASE(newFoo);
}
}
printf("Plugin.cpp %x\n", proxyObject);


_______________________________________________
Mozilla-xpcom mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-xpcom

Reply via email to