Re: I have a VB project, but VC/COM question(s)
Mystif <none@ThisTime.net> wrote:
On Thu, 27 Mar 2008 14:37:16 -0400, "Igor Tandetnik"
<itandetnik@mvps.org> wrote:
Alex Blekhman <tkfx.REMOVE@yahoo.com> wrote:
"SvenC" wrote:
You cannot do anything. The VC app developers must expose a COM
interface which is OLE automation compatible. Otherwise you
cannot
use it from VB.
IIRC, VB6 could use COM component directly without requiring
IDispatch
... but only if the interface is automation compatible (marked
[oleautomation] in the IDL).
So if I used OLEViewer to create an IDL from the exe could I make the
change and recreate the TypeLib myself?
Well, if the interface is actually automation compatible (that is, it
uses only automation types) but the author simply forgot to mark it
[oleautomation], then yes - you can grab the IDL, fix it, compile it
into a TLB and use that in VB.
It is also sometimes possible to hand-craft automation-compatible IDL
definition for a non-automation interface: it is somewhat fragile, but
as long as your fake interface is binary compatible with the real one,
you can get away with it. I've seen things like declaring pointer
parameters as long, and using VarPtr on VB side. You need a good grasp
of COM at the binary level to pull this off.
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925