Hello everyone,
Let me ellaborate on what I want to achieve - I simply want to accept a URL
from a user at the prompt and load the corresponding document into a browser
myself.
For which I considered the design would be (and please correct me if I m
wrong):
1. Invoke a method in nsIDocumentLoader with the URL to get back the content
type and the
DocumentLoaderFactory that would handle that content type
2. Invoke the CreateInstance method on this Factory to get the Content
Viewer and Stream Listener
3. And finally embed this Content Viewer in a ContentViewerContainer to load
the document.
So, for Boris's first question I would need
1. getService() call on nsIDocumentLoader (and I guess it would be on
the root window because I
am
interested in only a single window)
2. CreateInstance() for nsIDocumentLoaderFactory (also indirectly
getting an instance of another
object)
3. The assumption I made here is that a document embedded in a Content
Viewer is as good as
the one that gets displayed ....... in other terms it is the window
itself....
Please....Please let me know if I am heading in the right direction. Also,
it would be really of great help if someone could send me a small snipet of
accessing any component (may it be a factory/ interface or module)...
Thanks in advance
Sandesh
Sandesh Sethia wrote:
I am a novice developer and a complete newbie to XPCOM. For about
4-5 days now, I have been searching for documents that would help me write
C++ code to access already present XPCOM components but its all been in
vain. As everything present out there talks more (infact 99%) about
creating a component. But I am looking for accessing a comp.
The answer to this is "it depends on which component." Depending on what
component you want, the ways to access it vary from a getService() call (for
services) to getting the component from some other object, to creating an
instance yourself.
I would really appreciate if anyone can help me by sending me an
example on accessing any component (it would be great if it were
nsIDocumentLoader) starting from #include .......
Which nsIDocumentLoader? There's one for every window object (toplevel
window,
frame, iframe, etc) and one "root" docloader which is a service. Which one
are
you trying to use?
-Boris
_______________________________________________
dev-tech-xpcom mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-xpcom