LWW COM and IDL files
I must say, getting this to work is driving me a bit nuts; I'm hoping some problems I'm having are my fault due to some ignorance or that there are some common workarounds everyone else uses that I don't know about yet.
The biggest problem I'm having is getting COM interface methods to be visible from LW. This really shouldn't be as difficult as it has been, IMO. After all, the methods are just an index int an object's virtual table with arguments. It appears that I can't just hand-code an interface method (like I would a FLI function). Instead, from the documentation it seems I'm required to use #'MIDL to compile an IDL file. Sadly, most of the COM components I use do not have IDL files. So, I've begun resorting to just creating some IDL files by hand for them from the headers. But this feels like wasted work (and it's not working for me).
// test.idl - this is from memory, please excuse syntax errors
import "iunknwn.idl"
[ object, uuid(...) ]
interface ITest : IUnknown
{
HRESULT Foo();
}
}
MIDL refuses to find this file. I promise the file exists and I'm looking in the right place for it ;-). I'm starting to think that the error (File not found #P"test.idl") is just a generic error message passed down when MIDL fails to compile the file, but that's just a guess. Perhaps it isn't finding iunknwn.idl instead? Hopefully someone knows the answer to the above. But, isn't there a way for me to just hand-code the methods for an interface that I want to access? Something like:
(define-foreign-com-method (foo 4) ; 4=index to vtable
( #| args would go here |# )
:object uuid)
; implicit :return-type
; implicit :calling-convention
Hell, the object could almost be implicit (IUnknown) if you didn't care about error checking (since we're just executing code at an address and the only important detail is what's on the stack). This has to be doable somehow, since #'MIDL does it.
Thanks!
Jeff M.