|
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;
}
|
|
|
|
|
could you find out what happens to the thread handle value when the thread is not running?
also explore getexitcodethread api in msdn
--------------------------------------------
Suggestion to the members:
Please prefix your main thread subject with [SOLVED] if it is solved.
thanks.
chandu.
|
|
|
|
|
Hello Electron,
You can use GetExitCodeThread()[^]. If the function returns STILL_ACTIVE, then your thread is alive.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
But Can I use GetExitCodeThread() with out using AfxBeginThread(), becasue in this case I am using _beginthreadex()..
Is that safe ?
|
|
|
|
|
Hi Electron,
Sure you can. GetExitCodeThread() just needs thread handle and _beginthreadex() will return handle if it creates thread successfully. Have a look at the documentation from MSDN.
If successful, each of these functions returns a handle to the newly created thread.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Yes I did, Thank you
|
|
|
|
|
A negative vote for help?
Just kidding.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|