MIDL_user_free
-
I'm learning RPC (remote procedure call). I included "rpcndr.h", and add "Rpcrt4.lib" in object/library modules. When compiling, I got the following errors: Linking... interface_c.obj : error LNK2001: unresolved external symbol _MIDL_user_free@4 interface_c.obj : error LNK2001: unresolved external symbol _MIDL_user_allocate@4 Debug/22_rpc.exe : fatal error LNK1120: 2 unresolved externals Error executing link.exe. what am I missing? I am using VC6.0. Thanks a lot for any help!
-
I'm learning RPC (remote procedure call). I included "rpcndr.h", and add "Rpcrt4.lib" in object/library modules. When compiling, I got the following errors: Linking... interface_c.obj : error LNK2001: unresolved external symbol _MIDL_user_free@4 interface_c.obj : error LNK2001: unresolved external symbol _MIDL_user_allocate@4 Debug/22_rpc.exe : fatal error LNK1120: 2 unresolved externals Error executing link.exe. what am I missing? I am using VC6.0. Thanks a lot for any help!
According to MSDN: The
midl_user_allocate
function is a procedure that must be supplied by developers of RPC applications. It allocates memory for the RPC stubs and library routines. Example:void __RPC_FAR * __RPC_USER midl_user_allocate(size_t cBytes)
{
return ((void __RPC_FAR *) malloc(cBytes));
}The
midl_user_free
function also must be written by the developer. Example:void __RPC_API midl_user_free(void __RPC_FAR * p)
{
free(p);
}Best wishes, Hans
-
According to MSDN: The
midl_user_allocate
function is a procedure that must be supplied by developers of RPC applications. It allocates memory for the RPC stubs and library routines. Example:void __RPC_FAR * __RPC_USER midl_user_allocate(size_t cBytes)
{
return ((void __RPC_FAR *) malloc(cBytes));
}The
midl_user_free
function also must be written by the developer. Example:void __RPC_API midl_user_free(void __RPC_FAR * p)
{
free(p);
}Best wishes, Hans