Default parameters in COM

A

abedford

Hi,

I would like to add a default parameter to a COM function. I defined
it in the IDL file like this:
HRESULT GetName( [in] BSTR id1
, [in] BSTR id2
, [in, defaultvalue("False")] BOOL disableSignin
, [out, retval] BSTR** pName );

But when I try to implement this function in COM, I can't set the
default value because it is not the last parameter... and I have to
keep the return value as the last parameter (to stop from breaking
client's codes etc.).

Am I wrong in thinking it should be possible to set a default
parameter in a COM function? How do you get around having the return
value at the end of the list of parameters or is it only possible on a
void function?

Thanks.
 
R

red floyd

abedford said:
Hi,

I would like to add a default parameter to a COM function. I defined
it in the IDL file like this:
HRESULT GetName( [in] BSTR id1
, [in] BSTR id2
, [in, defaultvalue("False")] BOOL disableSignin
, [out, retval] BSTR** pName );

But when I try to implement this function in COM, I can't set the
default value because it is not the last parameter... and I have to
keep the return value as the last parameter (to stop from breaking
client's codes etc.).

Am I wrong in thinking it should be possible to set a default
parameter in a COM function? How do you get around having the return
value at the end of the list of parameters or is it only possible on a
void function?

Well, since IDL is not topical for this group, I would suggest you try a
newsgroup dedicated to your platform.

Please see FAQ 5.9 for a list of possible newsgroups.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,772
Messages
2,569,593
Members
45,112
Latest member
VinayKumar Nevatia
Top