16,467
社区成员
发帖
与我相关
我的任务
分享
COutput temp;
m_Value= temp.Output();
//m_Value=3.1415926;
UpdateData(FALSE);
[/quote]
恐怕不能这样用。因为其实我的本意并非只是想输出一个a变量的值这么简单,如果这样简单,只在按钮的触发函数里面直接输出就是了。
本意是在Output这个函数里,做一个比较耗时间的循环迭代优化计算,这个Output函数还会调用其他很多函数,我想在这个循环计算的过程中,监视若干个变量的值,这几个变量的值是循环迭代计算过程中的中间结果,是为了看这个循环迭代优化过程是否正确。
为了结构化看得清楚,所以把所涉及到的大概20个函数,分成了几个cpp文件。
所以,还是要求在Output函数中,如何输出变量的值。并且,猜测用UpdateData(FALSE)可能达不到目的。因为我要看迭代过程的输出,用UpdateData(FALSE)会不会把上次的迭代输出结果冲掉啊?
以前我是用C++ Builder的,的确比VC++在使用方面方便多了。
看样子,C++ Builder是给业余程序员用的,VC++是给专业程序员用的。
我之所以转向VC++,是为了使用OpenMP或者Intel TBB等并行计算功能,加快计算速度。
COutput temp;
m_Value= temp.Output();
//m_Value=3.1415926;
UpdateData(FALSE);
CStudyDlg* g_Dlg=NULL;
BOOL CStudyDlg::OnInitDialog()
{
CDialogEx::OnInitDialog();
// Add "About..." menu item to system menu.
// IDM_ABOUTBOX must be in the system command range.
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000);
CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
BOOL bNameValid;
CString strAboutMenu;
bNameValid = strAboutMenu.LoadString(IDS_ABOUTBOX);
ASSERT(bNameValid);
if (!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
}
}
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
// TODO: Add extra initialization here
g_Dlg=this;
return TRUE; // return TRUE unless you set the focus to a control
}
#include "stdafx.h"
extern CStudyDlg* g_Dlg;
int DataOutpit()
{
double aaa;
return (0);
}