|
CPallini wrote: www.cpallini.freeproductz.com.
I thought you would only provide this helpful link for people who put urgentzz, sendz codez plzz in the subject line...
|
|
|
|
|
Just see below. Actually the OP fell for it.
Link ^
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
Michael Schubert wrote: I thought you would only provide this helpful link for people who put urgentzz, sendz codez plzz in the subject line...
Indeed.
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]
|
|
|
|
|
|
That's a complete surpise to me! I should absolutely fix it.
BTW Did you give a try to either:
(a) Avoiding duplicate insertions, as suggested by Rajesh
or
(b) Eliminate the duplicate items, as suggested by Me
?
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 could use a hashtable to filter out the dups. Like CMapStringToString (if you are using MFC).
|
|
|
|
|
As Rajesh said - the best way is to avoid adding duplicates.
Well, if something is blocking you from that, you could use stl::set[^] to remove duplicate entries. Well, you have to pay penalty for performance.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Here i am sending a code which is adding string.And plz tell me how can i remove to add duplicate string..
BOOL CUSBDlg::FileList()
{
//Get Logical Drives
DWORD dwDrives=GetLogicalDrives();
if(0==dwDrives)
{
// return FALSE;
}
DWORD dwCount=0;
char chDriveLabel='A';
char szRootpath[5]={0,0,0,0,0};
while(dwDrives !=0)
{
if ((dwDrives & 1) != 0)
{
sprintf(szRootpath,"%c:\\",chDriveLabel);
//removable drive
if(DRIVE_REMOVABLE==GetDriveType(szRootpath))
{
WIN32_FIND_DATA FindFileData;
HANDLE hFind;
//Removable dirve lable
// std::cout <<"Files in " << szRootpath << std::endl;
m_ListCountries.AddString(szRootpath);
m_tree.InsertItem(szRootpath);
//* represent search all files and directories
szRootpath[3]='*';
hFind=FindFirstFile(szRootpath,&FindFileData);
if (INVALID_HANDLE_VALUE == hFind)
{
// return FALSE;
}
// List all the files in the directory .
do
{
//ignore the sub directories
if (strcmp(FindFileData.cFileName,_T(".")) && strcmp(FindFileData.cFileName,_T("..")))
{
m_ListCountries.AddString(FindFileData.cFileName);
m_tree.InsertItem(FindFileData.cFileName);
}
}while (FindNextFile(hFind, &FindFileData) != 0);
FindClose(hFind);
}
}
dwDrives = dwDrives >> 1;//next drive
chDriveLabel++;
}
return true;
}
Plz help me
|
|
|
|
|
Could you please re-post the code snippet enclosed in "Code Block" so that it will be more easier to read.
NewVC++ wrote: Here i am sending a code which is adding string.And plz tell me how can i remove to add duplicate string..
Well, in the code, Which item do you want to be unique? Being more specific will fast up the responses.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
I am making a Windows service In MFC.I want to show a UI on it. Is it possible? How?
modified on Wednesday, August 20, 2008 7:15 AM
|
|
|
|
|
sumit.durg wrote: I am making a Windows service.I want to show a UI on it. Is it possible? How?
While creating a service you need to specify the flag
SERVICE_INTERACTIVE_PROCESS or Open services.msc and goto the logon tab and check "Allow service to interact with desktop" checkbox.
Nibu babu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
|
|
|
|
|
You really should avoid showing ANY user interface in a Windows Service, they typically run when no one is logged in so there is no-one at the PC to either see the UI or use it.
Also, as a Service usually runs as a different user account to the currently logged on user they will not see the UI anyway, especially in Vista when they use a special desktop.
|
|
|
|
|
Windows Vista and Windows Server 2008 no longer permit interactive UI on the user's desktop. More information[^].
DoEvents: Generating unexpected recursion since 1991
|
|
|
|
|
Hi All
I am useing list box in vc2005.I use for add string like this [code]m_ListCountries.AddString(szRootpath);[/code].But i am not abel to delete item from list box.Plz help me..
Thx's in advance
|
|
|
|
|
DeleteString() Deletes a string from a list box.
DeleteItem Called by the framework when the user deletes an item from an owner-draw list box.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
I had try this one when i am useing this[code]m_ListCountries.DeleteString(szRootpath);[/code] then i am geting error like this
error C2664: 'CListBox::DeleteString' : cannot convert parameter 1 from 'char [5]' to 'UINT'
|
|
|
|
|
vcprog wrote: C2664: 'CListBox::DeleteString' : cannot convert parameter 1 from 'char [5]' to 'UINT'[/code]
you need to pass the index of the item you want to delete. you are passing the string itself which is not intended to be the parameter type to DeleteString()
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Please, next time you have a problem like this, first make sure you have read the documentation on MSDN, it is clearly explained how you have to use the function.
|
|
|
|
|
1. Please use inline code button instead of your custom [code][/code] tags.
2. Use CListBox::DeleteString [^]to delete a list box item.
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]
|
|
|
|
|
|
|
Can you show your code,how did you try?
|
|
|
|
|
Hi,
I am writing one dialog application. In that i have two dialogs. In the first dialog i am having one button to call the second dialog. In that button code i am closing the first dialog and opening the second one. This is working fine. My problem is for the second dialog i have created task bar icon using ModifyStyleEx(0, WS_EX_APPWINDOW. But i dont know how to create icon in task manager. Can any one solve this? Thanks in advance.
|
|
|
|
|
Does the MFC/some other icon shows alongwith your application name in the task manager?
hari_honey wrote: create icon in task manager
Are you sure you changed both the 32x32 and 16x16 icons in your application
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
for the first dialog it shows an icon in the task manager.
|
|
|
|