Hi !
I'm encountering problems with a COM interface I defined. My .idl file
contains definitions for all the methods of the interface and some
class is implementing them. But when I add my object (a control in this
case) in some test app, and browse the interfaces it defines, all my
definitions have changed !
As an example, I define the following interface and class in the .idl
file :
// TestATL.idl file
[
uuid(F1C4329F-71C7-435b-ADE3-43A5A454EE7D),
object,
dual,
helpstring("COMTest interface")
]
interface ICOMTest : IUnknown
{
[id(1)] HRESULT TestMethod([in, out] ICOMTest **retVal);
[id(2), helpstring("method TestMethod2")] HRESULT
TestMethod2([in,out] IUnknown** in0);
}
[
uuid(A4752AC3-6003-4c38-86EC-8A5CCDFC671B),
version(1.0),
control,
helpstring("COMTest coclass")
]
coclass CCOMTest
{
[default] interface IComTest;
}
// End of TestATL.idl
The single method is implemented in the corresponding class CComTest.
I'm only deriving my class from ICOMTest, and implementing AddRef,
Release and QueryInterface myself.
I then create a small .NET app with a single form. I open the toolbox
and add my control to the list, and then to the form. Now the Object
Browser shows my lib, I browse to the ICOMTest interface, and here's
what I see for the definition of TestMethod :
public abstract new void TestMethod ( TestATLLib.CCOMTest retVal )
So the HRESULT return value disappears, and I can't get it, and more
than that, the ICOMTest parameter becomes a CCOMTest, which is really
annoying the purpose of interfaces is to hide the implementation !!
So did I did something wrong ? And what should I do so that my method
looks like the definition I gave when I browse it from an app that uses
it ?
Thanks !
--
kettch
------------------------------------------------------------------------
kettch's Profile:
http://www.hightechtalks.com/m819
View this thread:
http://www.hightechtalks.com/t2342316