Solved

Question  on COM

Posted on 1998-11-16
1
158 Views
Last Modified: 2013-11-20
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
Comment
Question by:sankar012898
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 3

Accepted Solution

by:
plaroche earned 100 total points
ID: 1324795
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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Separate files macro - Errors on larger data set 18 76
Replacement selected text 2 69
sum28 challenge 31 117
no14 challenge 14 76
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …
Suggested Courses

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question