Click here to Skip to main content
15,886,724 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to communicate with server in vc++? Pin
T.RATHA KRISHNAN5-Jul-11 0:11
T.RATHA KRISHNAN5-Jul-11 0:11 
AnswerRe: How to communicate with server in vc++? Pin
Albert Holguin5-Jul-11 5:07
professionalAlbert Holguin5-Jul-11 5:07 
AnswerRe: How to communicate with server in vc++? Pin
David W. Young5-Jul-11 6:01
David W. Young5-Jul-11 6:01 
Question“Debug Error! R6010 -abort() has been called”- how to find the error? Pin
huangzhtao4-Jul-11 17:04
huangzhtao4-Jul-11 17:04 
AnswerRe: “Debug Error! R6010 -abort() has been called”- how to find the error? Pin
Richard MacCutchan5-Jul-11 0:12
mveRichard MacCutchan5-Jul-11 0:12 
AnswerRe: “Debug Error! R6010 -abort() has been called”- how to find the error? Pin
Albert Holguin5-Jul-11 5:00
professionalAlbert Holguin5-Jul-11 5:00 
QuestionRe: “Debug Error! R6010 -abort() has been called”- how to find the error? Pin
David Crow5-Jul-11 5:46
David Crow5-Jul-11 5:46 
QuestionHow to initialize a CProgressCtrl object in a CDialog derived object. Pin
Odysseas Z4-Jul-11 8:54
Odysseas Z4-Jul-11 8:54 
Hello everyone!

I have a CDialog derived class named CCalibrationDialog. As the name shows I want that dialog to control a procedure of a calibration (non-relevant: camera shutter/gain calibration). I would love to be able to show the progress of this procedure with a CProgressCtrl object but I have a little (maybe dumb) problem. I follow every step of this tutorial (http://www.codersource.net/mfc/mfc-tutorials/cprogressctrl.aspx[^]) which seems to show the easiest way to control the progress bar but my program asserts as if the CProgressCtrl is not initialized.

Here's a code snippet:
//CCalibrationDialog.h
#pragma once
#include "afxcmn.h"
// CCalibrationDialog dialog
class CCalibrationDialog : public CDialog
{
	DECLARE_DYNAMIC(CCalibrationDialog)

public:
	CCalibrationDialog(CWnd* pParent = NULL);   // standard constructor
	virtual ~CCalibrationDialog();

// Dialog Data
	enum { IDD = IDD_DIALOG_CALIBRATION };
	CProgressCtrl m_ProgressCtrl;
.
.
.
protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	virtual BOOL OnInitDialog();
	DECLARE_MESSAGE_MAP()
public:
	afx_msg void OnBnClickedButtonCalPrg();
};
//CCalibrationDialog.cpp
void CCalibrationDialog::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	DDX_Control(pDX, IDC_PROGRESS_CAL, m_ProgressCtrl);
}

BOOL CCalibrationDialog::OnInitDialog()
{
        m_ProgressCtrl.SetRange(0,100);
	m_ProgressCtrl.SetStep(10);
	return true;
}
.
.
.
void CCalibrationDialog::OnBnClickedButtonCalPrg()
{
	m_ProgressCtrl.StepIt();
}


Any ideas?
Thanks a lot for any feedback!
Ody Z.

QuestionRe: How to initialize a CProgressCtrl object in a CDialog derived object. Pin
Mark Salsbery4-Jul-11 9:01
Mark Salsbery4-Jul-11 9:01 
AnswerRe: How to initialize a CProgressCtrl object in a CDialog derived object. Pin
Odysseas Z4-Jul-11 9:05
Odysseas Z4-Jul-11 9:05 
GeneralRe: How to initialize a CProgressCtrl object in a CDialog derived object. Pin
Mark Salsbery4-Jul-11 9:12
Mark Salsbery4-Jul-11 9:12 
GeneralRe: How to initialize a CProgressCtrl object in a CDialog derived object. Pin
Odysseas Z4-Jul-11 9:20
Odysseas Z4-Jul-11 9:20 
GeneralRe: How to initialize a CProgressCtrl object in a CDialog derived object. Pin
Mark Salsbery4-Jul-11 9:30
Mark Salsbery4-Jul-11 9:30 
GeneralRe: How to initialize a CProgressCtrl object in a CDialog derived object. Pin
Odysseas Z4-Jul-11 9:33
Odysseas Z4-Jul-11 9:33 
GeneralRe: How to initialize a CProgressCtrl object in a CDialog derived object. Pin
Mark Salsbery4-Jul-11 9:35
Mark Salsbery4-Jul-11 9:35 
QuestionHow to implement CALLBACK_THREAD ( MFC worker thread) in waveInOpen API ? Pin
Vaclav_4-Jul-11 4:25
Vaclav_4-Jul-11 4:25 
AnswerRe: How to implement CALLBACK_THREAD ( MFC worker thread) in waveInOpen API ? Pin
«_Superman_»4-Jul-11 7:33
professional«_Superman_»4-Jul-11 7:33 
GeneralRe: How to implement CALLBACK_THREAD ( MFC worker thread) in waveInOpen API ? Pin
Vaclav_4-Jul-11 7:48
Vaclav_4-Jul-11 7:48 
QuestionHow to store Hexa value in a Text field of a table Pin
Amrit Agr3-Jul-11 21:25
Amrit Agr3-Jul-11 21:25 
AnswerRe: How to store Hexa value in a Text field of a table Pin
Randor 3-Jul-11 23:53
professional Randor 3-Jul-11 23:53 
GeneralRe: How to store Hexa value in a Text field of a table Pin
LiangGuangLin4-Jul-11 2:58
LiangGuangLin4-Jul-11 2:58 
GeneralRe: How to store Hexa value in a Text field of a table Pin
Randor 4-Jul-11 3:22
professional Randor 4-Jul-11 3:22 
GeneralRe: How to store Hexa value in a Text field of a table Pin
LiangGuangLin4-Jul-11 3:45
LiangGuangLin4-Jul-11 3:45 
GeneralRe: How to store Hexa value in a Text field of a table Pin
Richard MacCutchan4-Jul-11 6:19
mveRichard MacCutchan4-Jul-11 6:19 
GeneralRe: How to store Hexa value in a Text field of a table Pin
Maximilien4-Jul-11 7:08
Maximilien4-Jul-11 7:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.