开发者

how to pass a windows structure to a method defined in an interface of an IDL file?

开发者 https://www.devze.com 2022-12-20 03:33 出处:网络
If I want to pass a structure defined in windows.h to one of method of a given interface then how can i do that in an IDL?

If I want to pass a structure defined in windows.h to one of method of a given interface then how can i do that in an IDL?

Suppose the structure be SECURITY_DESCRIPTOR which is Declared in Winnt.h; include Windows.h and my interface be

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

Thanks in Ad开发者_StackOverflow社区vance.


I've ripped the following from one of our IDL files, you just need to do the same sort of thing.

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;

You will just have to redefine the structures you need yourself in the same way.

0

精彩评论

暂无评论...
验证码 换一张
取 消