bebo
bebo

Reputation: 67

problem convert idl to tlb

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

Upvotes: 0

Views: 1653

Answers (1)

Hans Passant
Hans Passant

Reputation: 941218

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.

Upvotes: 1

Related Questions