QueryInterface woes with multiple interfaces (only one dispinterface)

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



argh... this is driving me crazy. I have a couple of objects which I'm
trying to implement multiple interfaces. One is a dispinterface that is
used for scripting languages, the other(s) are regular (not disp/dual
interfaces) used among my objects for inter-object communication.

If I look at the object's type library, the multiple interfaces show up
(using OLE/COM Viewer) in the coclass definition & I can see all the
methods. I've put them in my COM_MAP in the class's .h file. It looks
like if I QueryInterface from within the object's apartment, they all
show up. But if I QueryInterface a proxy, the other interfaces aside
from the dispinterfaces, fail with 0x80004002 (no such interface). If I
use OLE/COM Viewer to look at the class itself, those interfaces don't
show up either. I am confused!

from my .idl file (is this the right syntax for multiple interfaces? I
can't find an example):
coclass datastream
{
[default] interface Idatastream;
interface Irawdata_private;
};

from my .h file for the class:
/////////////////////////////////////////////////////////////////////////////
// Cdatastream
class ATL_NO_VTABLE Cdatastream :
public CComObjectRootEx<CComMultiThreadModel>,
public CComCoClass<Cdatastream, &CLSID_datastream>,
public ISupportErrorInfo,
public IDispatchImpl<Idatastream, &IID_Idatastream, &LIBID_DKEDXLib>,
public Irawdata_private
{
... other stuff ...

BEGIN_COM_MAP(Cdatastream)
COM_INTERFACE_ENTRY(Idatastream)
COM_INTERFACE_ENTRY(IDispatch)
COM_INTERFACE_ENTRY(ISupportErrorInfo)
COM_INTERFACE_ENTRY(Irawdata_private)
END_COM_MAP()

Irawdata_private (which derives from IUnknown, neither Idatastream nor
Irawdata_private depends on each other) does not seem to QueryInterface
properly work.

What kind of things should I look for? I'm perplexed.

.



Relevant Pages

  • Re: dhcp Server startet nicht mehr (Solaris)
    ... dass der Script killfalsch aufruft und daher ... > Multiple interfaces match the same shared network: ...
    (de.comp.os.unix.networking.misc)
  • Re: Interface Question
    ... so _how_ can an IShellLink be typecast to an IPersistFile.The actual object may implement both the lists. ... They are not totally disjoint, ... to other interfaces because they all include IUnknown.QueryInterface. ... to me to be the knowledge of an object's multiple interfaces. ...
    (comp.lang.pascal.delphi.misc)
  • Re: Questions about traffic shaping
    ... do egress shaping such that packets will be counted against one ... specific allocation even through the packets will be egressing via ... for multiple interfaces where shaping can be implemented. ...
    (comp.os.linux.networking)
  • Re: Clustering - how can I.......
    ... Failsafe IP allows a system with multiple interfaces (that is, ... adapters) to recover from the failure of any single adapter. ...
    (comp.os.vms)
  • Re: Java and OOP
    ... (extending more than one superclass). ... People would generally use multiple interfaces and/or delegation to accomplish the same ends. ... The use of interfaces is to establish a contract for the implementation class, and also because you can refer to an instance of such an implementing class by an interface type that it implements. ... Generics provide another powerful tool for type analysis and programming. ...
    (comp.lang.java.programmer)