|
Personally I think return(0) is clearer.
If I have seen further it is by standing on the shoulders of Giants. - Isaac Newton 1676
|
|
|
|
|
depends if you look at return as a function or statement. Personally I prefer return 0; cos, to me, its more of statement, can you imagine going int length = (0); everywhere? Nah me neither.
|
|
|
|
|
But wouldn't life be boring if we all agreed!
If I have seen further it is by standing on the shoulders of Giants. - Isaac Newton 1676
|
|
|
|
|
That it would be . As long as your consistent with whatever style you prefer, thats the main thing, and I'm sure we'll agree on that .
|
|
|
|
|
Dangleberry wrote:
As long as your consistent
100% in agreement, also whenever I am debugging/changing another persons code I try and use the same style as the original programmer, even if I hate it!
If I have seen further it is by standing on the shoulders of Giants. - Isaac Newton 1676
|
|
|
|
|
how do i create the following :
suppose I have a list box A containing several items and another list box B that will display the item selected in list box A each time the user push a "add" button. It should also undisplay the item when a "remove button" is pushed after selecting the item to be removed from list box B.
|
|
|
|
|
void CYourDialog::OnAddButton()
{
CString cText;
int nIndex;
nIndex = m_ComboboxA.GetCurSel();
if(nIndex == CB_ERR)
return;
m_ComboboxA.GetLBText(nIndex, cText);
m_ComboboxB.AddString(cText);
}
void CYourDialog::OnRemoveButton()
{
int nIndex;
nIndex = m_ComboboxB.GetCurSel();
if(nIndex == CB_ERR)
return;
m_ComboboxB.DeleteString(nIndex);
}
|
|
|
|
|
|
How can I add OnOK event in CPropertySheet
from class wizard?
Thanks in advance.
Shinya
|
|
|
|
|
If file is locked or really user have no permission to write to the file?
Thanks,
Brian
|
|
|
|
|
|
but then again, maybe its simpler than that - I wonder if an attempt to open the file would produce a trappable 'no permissions error' - sorry, I cant check this right now (dont have MSDN here at the office)
'G'
|
|
|
|
|
Use the _access api
with which u can check for the access to the file and solve teh bug
Thanx
TAKE CARE
|
|
|
|
|
Sorry no go,
_access calls dosmapper => EACCES when file is locked, when permission denied.
as well as it will lie about write access to network shares. _access will
report file/directory is writable when it isn't.
Thanks,
Brian
|
|
|
|
|
Hi guys
I'm managing a big array and I'm receiving this message when I execute the program (Unhandled exception in ...EXE: stack overflow). What can I do to try to solve it?
It's an array of a class (maybe this helps you to understand the problem).
Best Regards
Dr. Pi
|
|
|
|
|
Stack overflow, as the name implies, means your app process stack memory got overflew, so the best way to solve your problem could be moving your stuff from stack to the heap. Maybe you have put your "big array" of objects in the stack? For example:
My_Obj aObjs[9999]; // this could cause stack overflowing
// allocate them in heap instead:
My_Obj* pObjs = new My_Obj[9999]; // this could work
// ...
delete [] pObjs;
pObjs = NULL;
|
|
|
|
|
Recursive function calls can also cause a stack overflow if they get nested too deep.
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|
|
I want to get the selected row in
CDataGrid.
Something like
CDataGrid * pGrid;
long l_CurPos = pGrid -> GetCurrentPos();
Thanks in advance.
Shin
|
|
|
|
|
I'm looking for a tool that alllows me to plot data on something that looks like a digital scope. I am modeling embedded firmware on the PC using .NET C++ so that I get nifty windows and buttons. Now, we want to plot some of the variables. I know someone else must have thought of this, so I would like to have a plug-in of some sort to do this for me so that I don't have to figure out how to plot data. Any suggestions of 3rd party tools?
Kenny O'Dell
Sr. R&D Software Engineer
Mettler-Toledo Inc.
Inman, SC
|
|
|
|
|
|
I have created a combobox on a dialog box. I have added items to the combobox by this expression:
int test = m_wavetype.InsertString(-1,"Lorentzian");
This seems to work, but when I go to select an item from the combobox it looks empty. I click on the small (squashed) area below the combobox and "Lorentzian" comes up as the selected value. Why can I not see my options in the combobox? Do I have settings wrong?
Thanks in advance,
Jim D
|
|
|
|
|
The height of the drop-down box is to small.
In the resource editor, click on the "open drop box drop" button, you see the grab rectangle chage - change the height of it.
"Der Geist des Kriegers ist erwacht / Ich hab die Macht" StS
sighist | Agile Programming | doxygen
|
|
|
|
|
I am sorry, but I am using VC++ 6.0 and I do not understand what the "open drop box drop" is. Can you please be more specific.
Thanks for your quick reply.
Jim D
|
|
|
|
|
He just means click on the drop-box portion of the combo-box to have it show where the drop-down portion of the combo-box will show. This drag the bottom of the box down to make it bigger. Also note that the box can be bigger than the dialog it current is parented to.
Joel Lucsy
|
|
|
|
|
I have always had problems with combo box sizing too.
I tried to locate the "open drop box drop button" in resource editor andd had no luck.
Could you explain how to do this with a drop-list style combobox?
I have been using the work-around of changing the combobox style to simple because the simple style allows you to adjust the height. Then when you switch the style back to drop-list it keeps that height.
|
|
|
|