Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Overloaded function in COM 1

Status
Not open for further replies.

titanandrews

Programmer
Feb 27, 2003
130
US
Hello all,

In my idl, I have this interface
Code:
interface IMyInterface : IDispatch
{		
        [id(1), helpstring("method Init1")] HRESULT Init([in]BSTR string1, [in] BSTR string2);
        [id(2), helpstring("method Init2")] HRESULT Init ([in]BSTR string1);
}

Apparently, this is not allowed because when I run midl it complains about the second Init function redefining the first. Is there any way to get around this issue?


many thanks,

Barry
 
Code:
        [id(1), helpstring("method Init1")] HRESULT Init([in]BSTR string1, [in, optional] BSTR string2);


-pete
 
So you're saying that you cannot overload a function, but just make parameters optional?




Barry
 
[lol] Yeah, sorry i messed up my post.

There was supposed to be a comment to that effect along with the code.
[hammer]

-pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top