• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 168
  • Last Modified:

Question on COM

hi ,
       I  have an  IDL file .I want  to know  how  to
declare  a  function pointer  as a  function argument in
the IDL file  .
 
when I declared it like -->

   int Save([in] FILE *fp , unsigned int (*pFn)(const void *buffer, size_t size, size_t count, FILE *stream));      

The MIDL compiler ignores  this  declaration  .

Here Save Method accepts a  file pointer and also  
a function pointer as an argument .However when I declared
it this way , the MIDL compiler ignored it .

I want  to  know  how  to  declare it  so  that  the
MIDL compiler accepts  it  .

If  you have any clue  to this  problem , please
let me know .


Thanks  in advance ,

bye
sankar



0
sankar012898
Asked:
sankar012898
1 Solution
 
plarocheCommented:
I don't think this can be done as explicitly, there's no real way for com to marshall this across interfaces.  You could pass this around as a (void*) and re-cast it on the server side.
Also, passing a function pointer seems a bit "non-com".  Your object you pass an interface pointer, which the server could use to call back.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now