1

如果我想将 windows.h 中定义的结构传递给给定接口的方法之一,那么我该如何在 IDL 中做到这一点?

假设结构是在 Winnt.h 中声明的 SECURITY_DESCRIPTOR;包括 Windows.h 和我的界面是

interface dummy { [helpstring("method ManageSecurity")]HRESULT ManageSecurity([in]SECURITY_DESCRIPTOR secDesc); }

提前致谢。

4

1 回答 1

1

我从我们的一个 IDL 文件中提取了以下内容,您只需要做同样的事情。

typedef [helpstring ("64 bit large integer")] struct {
    long dwLowDateTime;
    long dwHighDateTime;
} FILETIME;

typedef [helpstring("WIN32_FIND_DATA structure")] struct {
    DWORD dwFileAttributes;
    FILETIME ftCreationTime;
    FILETIME ftLastAccessTime;
    FILETIME ftLastWriteTime;
    DWORD nFileSizeHigh;
    DWORD nFileSizeLow;
    DWORD dwReserved0;
    DWORD dwReserved1;
    unsigned char   cFileName[_MAX_PATH];
    unsigned char   cAlternateFileName[ 14 ];
} WIN32_FIND_DATA;

你只需要以同样的方式重新定义你自己需要的结构。

于 2010-03-04T17:06:14.530 回答