|
this also works from code :
#pragma warning(disable : 4786)
|
|
|
|
|
Yes but the problem there is that the warning is coming from the STL itself, so, you have to put this pragma in each file you are dealing with vectors, strings, ...
Quite annoying, so it is easier to simply disable them in the properties of your project.
|
|
|
|
|
what about stdafx.h ?
|
|
|
|
|
Yes, but what if you don't use precompiled headers ?
Anyway, both solutions are correct
|
|
|
|
|
I always use a "stdstl.h" header that includes all the STL/Boost files I need, with the necessary pragmas to disable the warnings.
|
|
|
|
|
even precompiled headers are disabled, you can always provide the header, can't you ?
|
|
|
|
|
Cedric Moonen wrote: you should be able to disable them
This depends on the version of VC. In VC++ 6, even with SPs, there is a bug that does not make it possible to remove these warnings.
~RaGE();
|
|
|
|
|
I'd guess you’re using MSVC6. The debug format used with this version was designed before templates became so popular and can't cope with the long symbol names generated when templates are used. You can suppress then using #pragma warning(disable : 4786) . I usually put it in my "stdafx.h" file.
Steve
|
|
|
|
|
Hi,
i have just started learning Vc++. can any one help me with my problem.
i want to insert,delete an item to list box control how to do that?? and to insert folder name in list box? and also i want to access the each item(folder name).
please can anyone help me....
|
|
|
|
|
|
maybe it is some helpful to you
SetCurrentDirectory("c:\\");
m_List2.Dir(DDL_DIRECTORY|DDL_EXCLUSIVE, _T("*.*"));
//example
m_List2.DeleteString(0);
m_List2.AddString("Welcome");
m_List2.InsertString(0,"Hi");
|
|
|
|
|
Hi,
i just added addstring code to project for add button but i am getting the below error.
////code/////
void CUpdateDlg::OnAdd()
{
m_LIST.AddString("Welcome");
}
/////////////
Error:-
Compiling...
UpdateDlg.cpp
D:\Parichay\DesktopSearch\UpdateDlg.cpp(63) : error C2039: 'AddString' : is not a member of 'CString'
c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(368) : see declaration of 'CString'
Error executing cl.exe.
DesktopSearch.exe - 1 error(s), 0 warning(s)
Regards,
Parichay B.P
|
|
|
|
|
m_List seems to be a CString object, not a list !!!
how do you declare it ??
|
|
|
|
|
i just created member variable for IDC_LIST (list box) using MFC class wizard.
there i declared m_LIST of type CString.
i have just started with vc+ i have no idea how these things works.
can u plz help me in adding items to list box and deleting item from list box.
|
|
|
|
|
AddString() is not a member of the CString[^] class.
what did you want to do with this ?
if IDC_LIST is a CListBox, it doesn't have any sense to associate it to a CString variable !!!
explain you wished algorithm for that OnAdd() method please...
|
|
|
|
|
The problem is i have created a list box with add , remove button & edit box.
during the execution of the program i want the contents of the edit box to be added to list box when i click on add button.
so tell me hw to start working with list box and declaring member variables for list box..
where and which function in my program i have use.
|
|
|
|
|
the list is a list (CListCtrl), and the edit stays an edit (CEdit).
what you have to do is :
1. read the edit
2. add to the list
CString strCaption;
m_Edit.GetWindowText(strCaption);
m_List.AddString(strCaption);
do you understand it better now ?
|
|
|
|
|
can u plz tell how to remove the item using the remove button and reset the list
|
|
|
|
|
|
read this carefully
http://codeproject.com/combobox/listbox_tut.asp
|
|
|
|
|
parichaybp wrote: there i declared m_LIST of type CString.
Delete the variable and recreate it as a CListBox instead.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
parichaybp,
AddString is function in CListBox not CString
you should declare a variable ListBox:
you eneter ListBox Control in your form
and then right click in control(ListBox) and declare a variable for this control
Now you can use this this function or functions
You can use this code
CString Str;
Str="This is test";
m_List.AddString(Str);
or other functions
|
|
|
|
|
WhiteSky, i have one question for you :
1. do you read the other answers when replying to a post ?
2. (implisit one) Why do you repeat my answers ?
|
|
|
|
|
whats happen?
1-yes i see all answers, but sender reply to my answer
well I should reply to question(parichaybp )
2-you're good programer,and if my answer and your answer is equal because question is same
( is good )
And have a nice day
|
|
|
|
|
Thanks its working. items are getting added.
|
|
|
|