|
-
November 12th, 2002, 06:38 AM
#1
Variable number of arguments in COM interface method
Hello All,
I have a method being declared in a COM Interface. I want this method to take variable number of arguments.
Hence I declared the method as follows in the "IDL" file.
LogMsg(long completionCode, long msgID, ...);
But during compilation time it is giving me an error as follows...
"cannot specify a variable number of arguments to a remote procedure : [ Parameter '...' of Procedure 'LogMsg' ( Interface 'IZLogger' ) ]"
your help will be highly appreciated
-
November 12th, 2002, 07:51 AM
#2
Search the site by vararg keyword.
-
November 12th, 2002, 08:21 AM
#3
With MIDL, you can use the "optional" keyword to specify arguments which are not required:
Code:
HRESULT MyFunc([in, optional] VARIANT Param1,
[out, optional] VARIANT Param2)
As far as I know, you cannot specify fully variable argument lists like in C++, at least not for non-inproc servers.
-
November 12th, 2002, 11:12 PM
#4
Thanks for your suggestions guys,
Is it possible to have variable list of arguments for in-proc servers. Please let me know cos I might have an option to convert it to in-proc
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|