0

i try to get a selected text and the word under mouse in firefox

after a lot of search i get the solution that i must access a document's HTML in Firefox using IAccessible

i found that solution in c++ in this link How to access a document's HTML in Firefox using IAccessible

the solution use ISimpleDOMNode.idl file so the first step to convert that solution from c++ to c# is convert

ISimpleDOMNode.idl to tlb file and convert tlb to dll fill

i try to use VS Command Prompt with this command to convert to tlb file midl ISimpleDOMNode.idl

but That generate ISimpleDOMNode.h and ISimpleDOMDocument.h, which define the interfaces. It also create ISimpleDOMNode_i.c and ISimpleDOMDocument_i.c but there is no tlb file

what is the wrong ?

this the link of ISimpleDOMNode.idl file

http://www.4shared.com/file/MddCFmXa/ISimpleDOMNode.html

Community
  • 1
  • 1
bebo
  • 67
  • 1
  • 10
  • You're trying to create a COM object that implements IAccessible? Why do you need the .tlb? Isn't that just for clients of your object that need to use a new interface you've defined? – Rup Jan 09 '11 at 22:33
  • ... or if you're actually trying to get an IAccessible *from* Firefox then you certainly don't need a .tlb. You're consuming objects, not creating them. – Rup Jan 10 '11 at 00:50
  • i get an IAccessible object Already but can not access a document's html like this problem in this link http://stackoverflow.com/questions/542395/how-to-access-a-documents-html-in-firefox-using-iaccessible – bebo Jan 10 '11 at 13:59

1 Answers1

1
interface ISimpleDOMNode : IUnknown {
    // etc..
}

That's where the buck stops, IUnknown derived interfaces are not Automation compatible. They are usable from C++ code, note the .h files generated by midl and the amount of cpp_quote() in the .idl file. An Automation compatible COM interface is derived from IDispatch and uses the sub-set of Automation compatible types for the function arguments. Variant, BSTR and SafeArray are popular choices.

Technically it is possible to re-declare the interface types in C# code, you just don't get any help from a type library to get that right. And you'll have to deal with the no-multiple-inheritance headache (not this one). Tlbimp.exe is powerless without a type library.

Use C++/CLI to get this going, you can write a ref class wrapper and you can #include the .h file.

Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536