007 996
007 996

Reputation: 31

MIDL only generates Simple.h, Simple_i.c, and Simple.tlb, but not dlldata.c and Simple_p.c for COM out-of-process server. How to fix this?

I am building a COM out-of-process (EXE) server and need to generate the proxy/stub files using the MIDL compiler. However, when I run the midl command, it only generates the following files:

  1. Simple.h
  2. Simple_i.c
  3. Simple.tlb

It does not generate the necessary dlldata.c and Simple_p.c files, which are required for the proxy/stub DLL.

Here is the IDL file (Simple.idl):

import "unknwn.idl";

[
    uuid(12345678-1234-1234-1234-123456789012),
    version(1.0)
]
library SimpleLib
{
    [
        uuid(F1C3B039-C7C1-4375-9EE2-B8E438F6C12A),
        object,
        pointer_default(unique)
    ]
    interface ISimple : IUnknown
    {
        HRESULT Add([in] int a, [in] int b, [out] int* result);
    }

    [
        uuid(2D84F751-A78D-4FAB-9B6F-93D6E94578C2)
    ]
    coclass Simple
    {
        [default] interface ISimple;
    }
}

And here is the command I am using to run midl:

midl /Oicf /env win32 /h Simple.h /iid Simple_i.c /proxy Simple_p.c /dlldata dlldata.c /tlb Simple.tlb Simple.idl

Despite specifying /proxy and /dlldata, the dlldata.c and Simple_p.c files are not being generated.

What I have tried:
1.I made sure the pointer_default(unique) attribute is included in the IDL file.
2.Verified that the IDL file defines at least one interface (ISimple) with remote methods.
3.Removed the local attribute to ensure remote call support.
4.Checked that the midl command is executed in a properly configured environment (Visual Studio Developer Command Prompt with access to unknwn.idl).

Why is midl not generating dlldata.c and Simple_p.c, and how can I resolve this issue to produce the required proxy/stub files?

Upvotes: 1

Views: 32

Answers (0)

Related Questions