1。我又两个对话框,一个探出另一个,在另一个中输入数据。在第一个中处理数据。
如何实现
2。我在stdafx.cpp中定义aa[100],如何在对话矿中使用

解决方案 »

  1.   

    全局变量 在 哪定义?在 stdafx.cpp定义 的变量在如何对话框引用?加extern提示错误
    D:\1111\MyDlg.cpp(78) : error C2057: expected constant expression
    D:\1111\MyDlg.cpp(78) : error C2466: cannot allocate an array of constant size 0
    D:\1111\MyDlg.cpp(78) : error C2440: 'initializing' : cannot convert from 'double' to 'double [100]'
            There are no conversions to array types, although there are conversions to references or pointers to arrays
      

  2.   

    假设第一个对话框为1dlg.cpp,第二个对话框为2dlg.cpp
    在2dlg.cpp定义全局变量int a=1;
    在1dlg.cpp中,
    1dlg dlg;
    dlg.DoModal();
    int b=dlg->a;
    这样就把2dlg.cpp中值1传给b了
    别忘了在1dlg.cpp中#include "1dlg.h"