如何让一个COM接口返回DOUBLE型指针

解决方案 »

  1.   

    接口函数中定义一个double**类型的out参数
      

  2.   

    HRESULT Proc7(
         [out] long  * pSize,
         [out, size_is( , *pSize)] double ** ppMyType); 
      

  3.   

    HRESULT Proc1(
        [in] short m;
        [in, size_is(m)] short a[]);  // If m = 10, a[10]
    HRESULT Proc2(
        [in] short m;
        [in, size_is(m)] short b[][20]);  // If m = 10, b[10][20]
    HRESULT Proc3(
        [in] short m;
        [size_is(m)] short * pshort); /* Specifies a pointer
                                      to an m-sized block of shorts */
    HRESULT Proc4(
        [in] short m;
        [size_is( , m)] short ** ppshort); /* Specifies a pointer 
                                           to a pointer to an m-sized 
                                           block of shorts */
    HRESULT Proc5(
        [in] short m;
        [size_is(m ,)] short ** ppshort); /* Specifies an
                                          m-sized block of pointers 
                                          to shorts */
    HRESULT Proc6(
        [in] short m;
        [in] short n;
        [size_is(m,n)] short ** ppshort); /* Specifies a pointer to an 
                                          m-sized block of pointers, each 
                                          of which points to an n-sized 
                                          block of shorts.*/
     HRESULT Proc7(
         [out] long  * pSize,
         [out, size_is( , *pSize)] my_type ** ppMyType); /* Specifies a pointer 
                                                  to a sized pointer, 
                                                  which points to a block 
                                                  of my_types, whose size is
                                                  unknown when the stub 
                                                  calls the server. */
      

  4.   

    double* p;是你要返回的指针,接口函数调用中YourInterface->SomeMethod(...,&p);就可以了