这个函数我也是用的他人的代码,前段时间执行正常, CoInitializeSecurity 会返回一个值,如正常为0,否则是非的负数,现在我程序中每次调这个函数都返回非0的负数?哪会知道怎用?解释一下?

解决方案 »

  1.   

    CoInitializeSecurity是OLE32.DLL里面的一个函数.
    在ActiveX中相应的导入函数式.  HR := CoInitializeSecurity(
        nil,                    // points to security descriptor
        -1,                     // count of entries in asAuthSvc
        nil,                    // array of names to register
        nil,                    // reserved for future use
        RPC_C_AUTHN_LEVEL_NONE, // the default authentication level for proxies
        RPC_C_IMP_LEVEL_IMPERSONATE,// the default impersonation level for proxies
        nil,                    // used only on Windows 2000
        EOAC_NONE,              // additional client or server-side capabilities
        nil                     // reserved for future use
        );
    看注解好象DCOM 安全方面?我也是一头雾水.