Hi, the Moz. plugin that I'm working on needs to know what the current scrollbars positions are, and I figured one way of doing this (is there an easier way?) would be to get access to an instance of one of the classes in Mozilla that I know have some knowledge about the scrollbars. In simpler terms, I want my plugin to have access to the instance of the ScrollableView interface that the browser is already using. My understanding of XPCOM is that making a call to: nsIServiceManager::GetService(..nsIScrollableView::GetIID()...) should return to me either a new instance of the ScrollableView interface if none were already registered, or an already existing one if it was registered. It appears however that I am always getting a new instance, as opposed to the one that the browser is already using. I've tried saving the ServiceManager (say sm) that is passed to the NSRegisterSelf function (these are needed in a plugin to allow it to self register I believe), and later on use it as: sm->GetService( ...nsIScrollableView::GetIID()..) but I get the same results: an new instance of a ScrollableView, as opposed to the one that the browser is already using. Most of the documentation and samples that I looked at usually talk about extending Mozilla in one direction: how to write a component that registers its interface and services with the idea that you can later on, from within Moz. code, call and access these services. But I am interested in doing things in the other direction: write a component that can get access to the (already instanciated) services of Mozilla... I have a feelling I might not be looking at the problem from the right angle, and that the solution is pretty simple, so I'll take any suggestion and comments! Denis -------- [EMAIL PROTECTED]
