A.exe调用B.dll,B.dll再调用C.dll,
现在想从A.exe中传一个数组的地址到C.dll,让C.dll能用到A.exe中的数据;
能这样做吗?

解决方案 »

  1.   

    我是这样想的:
    在c.dll中实现下面4个函数:
    void init(double* d_array);//a.exe调用这个函数,把数组的地址传到c.dll中;
    void read(void);//读,对数组操作,由b.dll调用
    void write(void);//写,对数组操作,由b.dll调用
    void uninit(void);//退出前处理其他一些事情
      

  2.   

    They are located in the same process space. No worry at all.
      

  3.   

    However, there is one catch: You better allocate and free memory in a single module (exe or dll). Don't allocate it in one and free it in another. That might cause you some trouble.
      

  4.   

    在C.DLL中可能要定义静态指针
    static void * p=NULL;
      

  5.   

    exe在调用dll时把dll函数地址,导入进来,其实就和你程序里面静态链接的函数一样.
    可以