简体   繁体   English

MFC进度栏问题和归档菜单生成

[英]MFC Progress Bar Issue And Filing Menu Generation

void combination::OnButton2()
{
    // TODO: Add your control notification handler code here
    m_progress.SetPos(0);
    m_progress.SetRange(0,100);

    combination a;
    a.make_combinations(0);
}

void combination::make_combinations(int lo_val)
{
    srand(time(0));
    m_progress.StepIt();
    ofstream fout("combination.txt",ios::app);
    ofstream fout2("time.txt",ios::app);

    for(int i=0; i<theApp.no_of_process; i++)
    {
        //m_progress.OffsetPos(100/4);
        //m_progress.SetStep(200);
        clock_t begin = clock();
        arr[lo_val] = i;
        if (lo_val == (theApp.no_of_tasks)-1)
        {
            for (int j=0; j<theApp.no_of_tasks; j++)
            {
                int number = arr[j];
                fout << Matrix[j][number];
            }
            fout<<endl;
        }
        else
        {
            //Sleep(2);
            //make_combinations(lo_val+1);
            clock_t end = clock();
            theApp.combination_time[i][0] = (diffclock(end, begin))/1000;
            fout2 << theApp.combination_time[i][0] << endl;
        }
    }
}

there is a dialog on mfc with a button behine that button am calling a recursive function. 在MFC上有一个对话框,其中包含一个按钮,说明该按钮正在调用递归函数。 i placed a progress bar on the same dialog that should tell me the progress of recursion. 我在同一对话框上放置了一个进度条,该进度条应告诉我递归的进度。 but iam gettin an error on clicking the button. 但是iam gettin单击该按钮时出现错误。 debug assertion failed. 调试断言失败。 your program caused an assertion failure. 您的程序导致断言失败。 i dnt know what is wrong with my code. 我不知道我的代码有什么问题。 please help!! 请帮忙!!

ISSUE NO 2: Iam making this project on MFC! 问题2:Iam在MFC上制作了这个项目! it includes brute force capability. 它具有蛮力能力。 It also has file handling in it!! 它还具有文件处理功能!! am stuck at another point! 卡在另一点! i have a couple of files with file writing! 我有几个文件正在编写中! my project has multiple files .txt format! 我的项目有多个.txt格式的文件! on the main MFC board i want to add an option for browsing those written files . 在MFC主板上,我想添加一个浏览这些书面文件的选项。 they should open in the format they are written! 它们应该以书面格式打开! any help how it can be done?? 任何帮助怎么办? just like a browsing menu! 就像浏览菜单一样! help?? 救命??

The assertion is probably because either the control does not exist on the dialog, or the variable m_progress has not been subclassed to the control. 该断言可能是因为该控件不存在于对话框中,或者变量m_progress尚未被子类化到该控件。 Make sure you have a DDX_Control entry for m_progress in your DoDataExchange function. 请确保你有一个DDX_CONTROL进入m_progress在你DoDataExchange功能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM