我这样:
在IDL 里加入:
[uuid(CFADAB42-57BF-4c3d-B9CD-5580A61A459A)]
struct ParamB
{
double   K;
double   T;
double   E; };
在IDL的最后加入:
struct ParamB;
给我的对象增加了一个属性
[propget, id(3), helpstring("property ParamB")] HRESULT ParamB([in] long  channel, [out, retval]struct ParamB *pVal);编译的时候老告诉我说 :
inapplicable attribute : [uuid] [ Struct 'ParamB' ( Parameter 'pVal' ) ]请问这是为什么?怎么解决谢谢

解决方案 »

  1.   

    http://www.mvps.org/vcfaq/com/4.htm
    For unknown reason, the MIDL compiler bundled with VC6 has not been updated even in SP4. Therefore, you need the latest Platform SDK installed on your computer (or at least no older than Platform SDK Jul'99) in order to compile the above IDL code and any IDL using structs with Automation. 
    http://www.mvps.org/vcfaq/com/5.htm
      

  2.   

    在IDL的最后加入:
    struct ParamB;
    应该不需要。请看:
    http://community.csdn.net/Expert/topic/3228/3228032.xml?temp=.7223474
    应该是需要typedef。
      

  3.   

    vc6:
    typedef struct _ParamB
    {
    double   K;
    double   T;
    double   E; }ParamB;
    vc.net:
    [export]
    struct ParamB
    {
    double   K;
    double   T;
    double   E; };