|
Pass the arguments as const references - it's much more efficient, since compiler doesn't need to create copies of arguments. You should also avoid returning objects like CArray by value - rather, pass 3rd argument as non-const reference.
Tomasz Sowinski -- http://www.shooltz.com
*** Vodka. Connecting people. ***
|
|
|
|
|
Tomasz is cool!
it has to be said, I see him answering so many questions!
|
|
|
|
|
good morning,
i have a dialogbased programm. when i open a first and then a second dialog (after i pressed a few buttons), i cannot close the first dialog, before i have closed the second dialog.
what must i change, that i can close the first dialog while the second dialog is still open.
sunny
|
|
|
|
|
You are opeen modal dialogs or modaless dialogs?
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
a modal dialog!
CTest d;
d.doModal();
|
|
|
|
|
You need to use modeless dialog. Instead of CDialog::DoModal() use CDialog::Create.
Tomasz Sowinski -- http://www.shooltz.com
*** Vodka. Connecting people. ***
|
|
|
|
|
i think i know what you mean. i wrote:
CTEST d;
d.doModal();
now i must write:
CTEST d;
d.Create(..???..);
right?
but what must i write into the clasp from the function Create?????
sunny
|
|
|
|
|
You have online help installed, haven't you?
Tomasz Sowinski -- http://www.shooltz.com
*** Vodka. Connecting people. ***
|
|
|
|
|
i have, the msdn library. but my english is not so good.....sorry
|
|
|
|
|
when i write
CTEST d;
d.Create(IDD_DIALOG1);
or
CTEST d;
d.Create(IDD_DIALOG1, NULL);
there is no errors. but when i use the programm i cannot use the modeless dialog. nothing happens when i press the button for this dialog.
sunny
|
|
|
|
|
1) check the 'Visible' flag in dialog properties (in Dialog Editor)
2) ensure that d isn't local variable. If it is, your dialog is destroyed almost immediately.
Tomasz Sowinski -- http://www.shooltz.com
*** Vodka. Connecting people. ***
|
|
|
|
|
YEAH! Great.....thanks.
|
|
|
|
|
A dialog Based application is a modal dialog.
And the second dialog u created seems to be also modal.
Modal means that u cannot do an action outside the dialog, till u dissmiss it by "OK" or "Cancel" (OnOK () and OnCancel () to be more accurate)
U can simulate that ur first dialog is closed by just not showing it:
ShowWindow ( SW_HIDE );
//Create ur dialog here
OnOK(); // Will close the first dialog when u finish from the second one
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Just a quick Q.
Does anyone know if there are any problems with working with multiple instances of VC++?
Are there any known global dependencies that might break one instance if, for instance, I start to debug?
|
|
|
|
|
Not to me
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Also, not for me...
My experience include several sessions of VS6 and VS.NET at the same time...
Cheers
Carlos Antollini.
Sonork ID 100.10529 cantollini
|
|
|
|
|
Not for me as well
I often use multiple instances of VC++ and had not experienced any odd behavior so far
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
thanks for the responses.
|
|
|
|
|
I pretty much use multiple instances all the time.
Todd Smith
|
|
|
|
|
I want to sort a change the sorting of a listbox.I tryed it as "virtual int CompareItem....." and as "afx_msg int CompareItem...." but these functions are never called and the list is sorted normally. What is the problem?
(except my english)
|
|
|
|
|
MSDN:
Called by the framework to determine the relative position of a new item in a sorted owner-draw list box. By default, this member function does nothing. If you create an owner-draw list box with the LBS_SORT style, you must override this member function to assist the framework in sorting new items added to the list box.
Short:
Have u set LBS_SORT style for the listbox??
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Only owner-draw listboxes use this message. If you have plain listbox and want to use non-standard sorting, then you'll have to sort yourself before adding items.
Tomasz Sowinski -- http://www.shooltz.com
*** Vodka. Connecting people. ***
|
|
|
|
|
Listbox is owner-draw fixed and LBS_SORT is set. Other functions (DrawItem, MeasureItem) are working well. Sorting work, but only standard not my way
|
|
|
|
|
I guess you have LBS_HASSTRINGS style set. With this bit enabled, you won't get WM_COMPAREITEM, because listbox assumes that sorting means string sorting.
Tomasz Sowinski -- http://www.shooltz.com
*** Vodka. Connecting people. ***
|
|
|
|
|
Listbox is owner-draw fixed and LBS_SORT is set. Other functions (DrawItem, MeasureItem) are working well. Sorting work, but only standard not my way
|
|
|
|