views:

490

answers:

1

I'm tyring to convert a MSVC project from VS 2005 to VS 2008. It contains a IDL file that outputs a header and stubs used for RPC. The VS 2005 project uses MIDL.exe version 6.00.0366. The VS 2008 project uses MIDL.exe version 7.00.0500.

Here's the problem: MIDL v6 outputs the following prototype for me to implement in my server code:

HRESULT PRC_Function(UINT input);

MIDL v7 with the same command line outputs this prototype:

HRESULT RPC_Function(handle_t IDL_handle, UINT input);

I don't want to have to go through and add the handle_t parameter to all my existing implementations. (Plus I still need the implementations to compile with VS 2005 for a while longer.)

Question: How can I get MIDL.exe v7 to output the same RPC server prototypes as v6?

+1  A: 

Looks like I can answer my own question...

MIDL v6 appears to automatically default the handle type to auto_handle for the server prototypes. MIDL v7 does not, so the solution is to use a Server.acl file with the auto_handle setting in it. This outputs a Server.h file with function prototypes that is the same between MIDL v6 and v7.

However, it also outputs a warning indicating that "auto_handle" has been depreciated. Instead I used implicit_handle(handle_t IDL_handle).

Too bad this site doesn't give me badges for answering my own questions. Nor can I flag my own answer as the correct answer.

Charles
Few people handle RPC. I discovered it here.
lsalamon
Charles - I'm one of the few who does use RPC, and I'm having a problem that sounds similar to yours, and wondered if you could post some more insight to your problem. My problem is that MIDL v7 tries to create Rundown routines in a second interface on the same service. MIDL v5 does not do this...
LarryF