A
Anthony Gonsalves
Guest
I am working on a Dialog Based application in MFC - using Visual Studio 2010, which has a vector of class CDataDisplayDialog (inherited from CDialog ) . Every CDataDisplayDialog is a Modeless dialog.
So there runs a loop which keeps adding CDataDisplayDialog pointers to the vector, and then a method is called to set the values on Edit box and Labels of the CDataDisplayDialog.
Now, this thing runs well till I have 100 pointers to the object of CDataDisplayDialog. But I ran into the problem when the application started throwing "Encountered an Improper Argument" dialog while adding the Dialogs to the vector. Precisely, after adding and creating 186 Modeless Dialogs of CDataDisplayDialog, the create call fails and returns false. I digged in a bit and found that the error is coming from CreateInternal.
Why it is happening if I have more than 186 objects.
I have checked my application a bit and found that I am not using Afx Ribbons
My application is Dynamically linked with MFC Dll ( even tried toggling it to static linking but it did not worked )
Dynamically linked with ATL
Tried /MD /MTd /MD flags ( nothing worked )
Optimization levels are also permuted as Not Set and O2 but alas , no luck!
Any help is appreciated.
Ohh BTW, Dialog contains 14 CEdit boxes, 3 List Ctrls , One IP Address bar and 18 Static labels.
Continue reading...
So there runs a loop which keeps adding CDataDisplayDialog pointers to the vector, and then a method is called to set the values on Edit box and Labels of the CDataDisplayDialog.
Now, this thing runs well till I have 100 pointers to the object of CDataDisplayDialog. But I ran into the problem when the application started throwing "Encountered an Improper Argument" dialog while adding the Dialogs to the vector. Precisely, after adding and creating 186 Modeless Dialogs of CDataDisplayDialog, the create call fails and returns false. I digged in a bit and found that the error is coming from CreateInternal.
Why it is happening if I have more than 186 objects.
I have checked my application a bit and found that I am not using Afx Ribbons
My application is Dynamically linked with MFC Dll ( even tried toggling it to static linking but it did not worked )
Dynamically linked with ATL
Tried /MD /MTd /MD flags ( nothing worked )
Optimization levels are also permuted as Not Set and O2 but alas , no luck!
Any help is appreciated.
Ohh BTW, Dialog contains 14 CEdit boxes, 3 List Ctrls , One IP Address bar and 18 Static labels.
Continue reading...