|
Hi,
I have insert the string value in the CListCtl using InsertItem method.
For example.
i have able to pupulate following value in the ClistCtl .My problem is how avoid repeted value that is 200.
100
200
200
200
kandly replay me.
Thanks.
|
|
|
|
|
You can iterate through the list and remove duplicate ones no? Also there are useful stl algorithms like unique which works on a sorted list, so before inserting you can call unique on the list.
|
|
|
|
|
Hi Thomas,
How can i call unique before inserting value to list.
kindly can you clarify me.
Thank.
|
|
|
|
|
Murugan k wrote: How can i call unique before inserting value to list.
You can use unique only if you have a std::list/vector/etc with you which instead you are inserting to a list control. But since you are directly inserting to the list control use CListCtrl::FindItem, if found don't insert.
I guess this will help?
|
|
|
|
|
Why don't you check before inserting?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
you can traverse thorough the list to see if the element you are going toinsert already exist or not.
if it exsist dont insert.
otherwise insert.
--------------------------------------------
Suggestion to the members:
Please prefix your main thread subject with [SOLVED] if it is solved.
thanks.
chandu.
|
|
|
|
|
Hi,
I have a Listcontrol which is populated with data.. I need to save all the data into a file (file type is not specific). on clicking a save button. Can I have a code snippet for this.
Thanks
|
|
|
|
|
where exactly are you getting the problem.
in getting the data from the list control or in saving the data to a file or both.
roughly, the algo should be something like this.
<pre>int n=m_list.GetItemCount();
FILE *fp;
fp=fopen("data.txt","w");
for(int i=0;i<n;i++)
{
m-list.GetItemText(i,&str);
fprintf(fp,"%s\n",str);
}
fclose(fp);</pre>
--------------------------------------------
Suggestion to the members:
Please prefix your main thread subject with [SOLVED] if it is solved.
thanks.
chandu.
|
|
|
|
|
V.K 2009 wrote: Can I have a code snippet for this.
Why do you need the code? I mean, what is your trouble about? Make an iteration writing every item data to the file.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi all,
I have trouble in parsing the XML Schema(XSD) file with the MFC VC++ dialog application. Please provide me an sample source code for parsing/traversing the XSD (XML SChema) with the MFC VC++ code. I need to extract all the tags(Elements, attributes, group elements,attribute groups, and etc) of the xsd with the MFC.
Regards,
Hema K
|
|
|
|
|
[^]
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi All,
how can I supress/hide "System Settings Change" message box using windows registry?
Vinu
Software Engineer
R&D Bangalore
|
|
|
|
|
In my system there is some virus that is keep on running.
Even if i delete that process form taskmanager it will start again.
How can i delete it manually or either progrmatically.
Please help me.
Regards
Deepu
|
|
|
|
|
you're going to have to delete the virus first or else it'll keep reloading the .exe process. focus on cleaning your system not on terminating the process
|
|
|
|
|
i cannot delete that exe as it is running.
|
|
|
|
|
deleting the exe will NOT get rid of the virus... its never that simple. Use proper antivirus/antispyware software(s) to scan your system and use it/them to delete the virus.
|
|
|
|
|
|
good luck and happy hunting
|
|
|
|
|
i once got this same type of issue.
by hit and error, first i deleted another process which creates this process. then i remembered that parentprocess name and repeated the same each time i booted my pc.
i suggest you to find out the process that creates your targeted process first and kill it.
--------------------------------------------
Suggestion to the members:
Please prefix your main thread subject with [SOLVED] if it is solved.
thanks.
chandu.
|
|
|
|
|
That is a good idea.
Thank you.
|
|
|
|
|
Deepu Antony wrote: Even if i delete that process form taskmanager it will start again.
Which means there are likely two running in tandem. If you have the path/name of the files in question, you could try adding them to HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations and reboot the machine.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Start windows in safe mode. Run various tools to see if they can uninstall the offender. If not, track down the offending app and the one that starts in and delete them. (If you know the name of the EXE, that can help in searching for a cleaner.)
Also look in both the services module in administrative tools, but also the registry for a service that is likely restarting this (the google updater program does this.)
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
How to find weather the thread is alive when using
somthing like..
hThread = (HANDLE)_beginthread()
while (hThread==Alive)
{
// do some thing
}
|
|
|
|
|
may not be an exact answer, but you can try this
make a flag 1 at the begining of the thread and make it 0 while returning.
use this in your primary thread.
while(flag==1)
{
//do some thing
}
--------------------------------------------
Suggestion to the members:
Please prefix your main thread subject with [SOLVED] if it is solved.
thanks.
chandu.
|
|
|
|
|
That may not work for me because I use BASE_ASSERT in thread fucntion
is there any work around
hThread = (HANDLE)_beginthread(ThFunction)
bDone=FALSE;
while (bDone != TRUE)
{
}
unsigned __stdcall ThFunction (void* param)
{
..........
..........
BASE_ASSERT(SomeFunction);
bDone = TRUE;
return 1;
}
|
|
|
|