Click here to Skip to main content
15,867,939 members

MFC VC++ 6.0 Progress Bar Issue And Menu Generation For Files Written

Haris Riaz asked:

Open original thread
C++
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. 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. 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! 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! on the main MFC board i want to add an option for browsing those written files . they should open in the format they are written! any help how it can be done?? just like a browsing menu! help??
Tags: C++, MFC, Bar

Plain Text
ASM
ASP
ASP.NET
BASIC
BAT
C#
C++
COBOL
CoffeeScript
CSS
Dart
dbase
F#
FORTRAN
HTML
Java
Javascript
Kotlin
Lua
MIDL
MSIL
ObjectiveC
Pascal
PERL
PHP
PowerShell
Python
Razor
Ruby
Scala
Shell
SLN
SQL
Swift
T4
Terminal
TypeScript
VB
VBScript
XML
YAML

Preview



When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  4. Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the http://www.codeproject.com/info/cpol10.aspx.



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900