Click here to Skip to main content
15,890,435 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
PinnedHOW TO ANSWER A QUESTION PinPopular
Chris Maunder12-Jul-09 22:37
cofounderChris Maunder12-Jul-09 22:37 
PinnedHOW TO ASK A QUESTION PinPopular
Chris Maunder12-Feb-09 17:19
cofounderChris Maunder12-Feb-09 17:19 
Questionchange exe icon not work with multiple stage icon file. Pin
Le@rner1-May-24 2:26
Le@rner1-May-24 2:26 
AnswerRe: change exe icon not work with multiple stage icon file. Pin
Victor Nijegorodov1-May-24 4:21
Victor Nijegorodov1-May-24 4:21 
GeneralRe: change exe icon not work with multiple stage icon file. Pin
jschell20hrs 18mins ago
jschell20hrs 18mins ago 
AnswerRe: change exe icon not work with multiple stage icon file. Pin
CPallini5hrs 20mins ago
mveCPallini5hrs 20mins ago 
GeneralRe: change exe icon not work with multiple stage icon file. Pin
Dave Kreskowiak5hrs 16mins ago
mveDave Kreskowiak5hrs 16mins ago 
GeneralRe: change exe icon not work with multiple stage icon file. Pin
CPallini5hrs 13mins ago
mveCPallini5hrs 13mins ago 
QuestionSOLVED Posting "debug (window ) view ? Pin
Salvatore Terress30-Apr-24 2:51
Salvatore Terress30-Apr-24 2:51 
AnswerRe: Posting "debug (window ) view ? Pin
Maximilien30-Apr-24 2:56
Maximilien30-Apr-24 2:56 
AnswerRe: Posting "debug (window ) view ? Pin
Victor Nijegorodov30-Apr-24 3:40
Victor Nijegorodov30-Apr-24 3:40 
QuestionObjects hierarchy ? Pin
Salvatore Terress29-Apr-24 5:15
Salvatore Terress29-Apr-24 5:15 
AnswerRe: Objects hierarchy ? Pin
Richard MacCutchan29-Apr-24 6:29
mveRichard MacCutchan29-Apr-24 6:29 
QuestionHow to track "nested objects "? Pin
Salvatore Terress18-Apr-24 8:34
Salvatore Terress18-Apr-24 8:34 
AnswerRe: How to track "nested objects "? Pin
Mircea Neacsu18-Apr-24 9:13
Mircea Neacsu18-Apr-24 9:13 
GeneralRe: How to track "nested objects "? Pin
Salvatore Terress18-Apr-24 14:57
Salvatore Terress18-Apr-24 14:57 
GeneralRe: How to track "nested objects "? Pin
Salvatore Terress19-Apr-24 4:00
Salvatore Terress19-Apr-24 4:00 
ADDENDUM

I am still trying to learn how to pass parameters to object.

My current "duplicating constructor" is because I am doing
it wrong.

My main object constructor is defined this way:



C++
MainWindow_Bluetooth::MainWindow_Bluetooth(QWidget *parent) :
       QMainWindow(parent),
       m_ui(new Ui::MainWindow_Bluetooth),
       m_status(new QLabel),
       m_console(new Console),
       // insert MDI area here ??
       m_mdiarea(new QMdiArea),

       m_settings(new SettingsDialog),
       //! [1]
       //! add rfcomm ??
       m_serial(new QSerialPort(this))
      // sequence 1st add HERE
      // must bbe passed to SettingsDialog
       // this is wrong parameter here ??
       //m_TAB_Connect(new A_BT_TAB_DIALOG),
       //m_TAB_Ext(new A_BT_TAB_DIALOG_EXT)


     //! [1]
   { // function apply \



hence I am passing settings(new SettingsDialog),
as a parameter.

SettingsDialog constructor:


C++
SettingsDialog::SettingsDialog(QWidget *parent) :
    QDialog(parent),
    m_ui(new Ui::SettingsDialog),
    m_status(new QLabel),
    // 3 sequence  add dialogs
    // HERE wrong  object
    m_TAB_Connect(new A_BT_TAB_DIALOG),
    // wrong  object
    m_TAB_Ext(new A_BT_TAB_DIALOG_EXT),
    m_intValidator(new QIntValidator(0, 4000000, this))
{



its in question / problem passed parameter is

m_TAB_Connect(new A_BT_TAB_DIALOG),

now for the source of this problem

I have TWO instances of SettingsDialog
and they point to TWO instances of A_BT_TAB_DIALOG
hence I end up with WRONG instances of A_BT_TAB_DIALOG


Can I modify my code to have TWO instances of A_BT_TAB_DIALOG
and make sure I point to the CORRECT instance ?

In my not so technical terminology
can I pass a parameter to
have something like

m_TAB_Connect(new A_BT_TAB_DIALOG),

m_TAB_Connect_Ext(new A_BT_TAB_DIALOG),


I am looking for a solution and I am open tor suggestions
leading to proper C++ solution.

Thanks
GeneralRe: How to track "nested objects "? Pin
Mircea Neacsu19-Apr-24 4:31
Mircea Neacsu19-Apr-24 4:31 
GeneralRe: How to track "nested objects "? Pin
Salvatore Terress19-Apr-24 7:11
Salvatore Terress19-Apr-24 7:11 
GeneralRe: How to track "nested objects "? Pin
Mircea Neacsu19-Apr-24 7:43
Mircea Neacsu19-Apr-24 7:43 
GeneralRe: How to track "nested objects "? Pin
k505419-Apr-24 8:16
mvek505419-Apr-24 8:16 
GeneralRe: How to track "nested objects "? Pin
Salvatore Terress19-Apr-24 9:48
Salvatore Terress19-Apr-24 9:48 
GeneralRe: How to track "nested objects "? Pin
k505419-Apr-24 10:58
mvek505419-Apr-24 10:58 
GeneralRe: How to track "nested objects "? Pin
Salvatore Terress20-Apr-24 15:38
Salvatore Terress20-Apr-24 15:38 
GeneralRe: How to track "nested objects "? Pin
Richard MacCutchan21-Apr-24 2:04
mveRichard MacCutchan21-Apr-24 2:04 

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.