|
I can just see a developer, patting himself on the back with having put together an exception handler and then stress testing to see it invoked and wondering why the messagebox is never displayed.
This is a really good example of not seeing the forest for the trees solution to a problem.
Chris Meech
I am Canadian. [heard in a local bar]
When no one was looking, every single American woman between the ages of 18 and 32 went out and got a tatoo just above their rumpus. [link[^]]
|
|
|
|
|
if we select the folder automatically all the files in the folder should be loaded in the listbox.iam able to select the folder but i don't know how to get the total number of files in folder and how to load this files into listbox,
please help me,
sree.
|
|
|
|
|
if you want to get files or folders if you use ListBox see DlgDirList and use m_ListBox.GetCount()
whitesky
|
|
|
|
|
actually my intension just like winamp application,in winamp we have two option add file or add folder.i write for files and i get a problem when i dealing with folders.
how we select the folder and how to add contentsof that folder to listbox.
thank u,
please help me,urgent .
sree
|
|
|
|
|
here is the sample snippet
CFileFind finder;
BOOL bWorking = finder.FindFile("*.*");
while (bWorking)
{
if (finder.IsDots())
continue;
if (!finder.IsDirectory())
{
bWorking = finder.FindNextFile();
m_ListBox.AddString((LPCTSTR) finder.GetFileName());
}
}
SaRath.
"Do Next Thing..."
My Blog | Understanding State Pattern in C++
|
|
|
|
|
Another way to do the same thing
extern CListBox* pmyListBox;
TCHAR lpszWinPath[MAX_PATH], lpszOldPath[MAX_PATH];
::GetWindowsDirectory(lpszWinPath, MAX_PATH);
::GetCurrentDirectory(MAX_PATH, lpszOldPath);
::SetCurrentDirectory(lpszWinPath);
pmyListBox->ResetContent();
pmyListBox->Dir(DDL_READWRITE|DDL_DIRECTORY, _T("*.*"));
::SetCurrentDirectory(lpszOldPath);
SaRath.
"Do Next Thing..."
My Blog | Understanding State Pattern in C++
|
|
|
|
|
|
first of all i add the files using follwing code
POSITION currPos;
char strFilter[] = { "Mp3 files (*.mp3)|*.mp3|All Files (*.*)|*.*||" };
CFileDialog avi(TRUE, ".mp3",NULL,OFN_ALLOWMULTISELECT | OFN_HIDEREADONLY, strFilter);
char drive[_MAX_DRIVE], middle[_MAX_PATH], filename[_MAX_FNAME], ext[_MAX_EXT];
if(avi.DoModal() == IDOK)
{
currPos = avi.GetStartPosition();
while(currPos != NULL)
{
m_SongName = avi.GetNextPathName(currPos);
_splitpath (m_SongName, drive, middle, filename, ext);
m_list7.AddString(m_SongName);
so tell atleast what modufication i should do to ad folder
|
|
|
|
|
|
ok!
how we use SHBrowseFolder it,
i know iam disturbing u,
really sorry,
but my work demands me please,
beacuse it is urgent,
sree.
|
|
|
|
|
sree_as wrote: how we use SHBrowseFolder it,
CString csFolderSelected;
BROWSEINFO bi = {0};
bi.ulFlags = BIF_RETURNONLYFSDIRS ;
LPITEMIDLIST pIt;
if( (pIt = SHBrowseForFolder( &bi )))
{
TCHAR tcPath[ MAX_PATH ];
if( SHGetPathFromIDList( pIt, tcPath ))
{
csFolderSelected = tcPath;
AfxMessageBox( "the user selected the folder " + csFolderSelected );
}
}
nave
|
|
|
|
|
After this,
TCHAR lpszOldPath[MAX_PATH];
::GetCurrentDirectory(MAX_PATH, lpszOldPath);
::SetCurrentDirectory(csFolderSelecter);
pmyListBox->ResetContent();
pmyListBox->Dir(DDL_READWRITE|DDL_DIRECTORY, _T("*.mp3"));
::SetCurrentDirectory(lpszOldPath);
This will work fine
SaRath.
"Do Next Thing..."
My Blog | Understanding State Pattern in C++
|
|
|
|
|
Thnak u sararth and naveen,
really it is working very nice,
thank u very much.
this is my friend login id because system has failed.
so iam sending message from my friend system.
thank u,
finally simple problem if i like to add items to listctrl instead of Listbox,
Dir function is not availble for that
what should i do
|
|
|
|
|
|
|
plz tell me where i found the function WM_ERASEBKGND to change color
in clas wizard
OnEraseBkgnd(CDC *pDC)
Please mail me
|
|
|
|
|
1. Go to Class Wizard and select required the message from the class (make sure that you have selected correct class) "Add Handler" there
2. Right click on the class and select "Add Message Handler"
SaRath.
"Do Next Thing..."
My Blog | Understanding State Pattern in C++
|
|
|
|
|
sir i am sorry what i dont understand
when i go to class wizard there is no function WM_ERASEBKGND
plz help me
Please mail me
|
|
|
|
|
|
i made a dialog based application
and now i want to change my dialog box color
i know that WMPAINT work for this what i want to use WM_ERASEBKGND
could it be possible
Please mail me
|
|
|
|
|
|
one simple way insert this codes in your file(I think you need to learning VC)but anyway for solve your problem use this
in header file
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
in cpp file insert
<br />
BOOL your class name::OnEraseBkgnd(CDC* pDC) <br />
{<br />
}<br />
whitesky
|
|
|
|
|
Depending on the class type (e.g. Dialog, MDI Child Frame, etc.), ClassWizard filters the messages.
To show all messages do the following:
- select "Class Info" tab;
- from "Message filter" combo box, choose "Window";
- go back to "Message Maps" tab; now all available messages are displayed in the "Messages" list.
Ovidiu Cucu
Microsoft MVP - Visual C++
|
|
|
|
|
You should open your dialog in dialog editor and then click on caption bar of your dialog. Then go to View --> Properties Window, activate the panel with Windows messages by clicking a toolbar button. Then select WM_ERASEBKGND event and add the handler.
The simplest handler can look like this:
BOOL CMyDialog::OnEraseBkgnd(CDC * pDC)
{
pDC->FillSolidRect(0, 0, 32000, 32000, RGB(0, 0, 255));
return TRUE;
}
|
|
|
|
|
Hi,
I'm looking for possible reason for the client connection failure with my server.
So for so good all clients where connected suddenly the client applications can't connect to the server appln. Only change happened is, there is a gradual increase in my users connecting & disconnecting from my server.
I use sockets for connections & when i debuged the client application with GetLastError() i receive WSAECONNREFUSED error when executing socket's 'Connect' method . I even tried telnet but receive 'couldnot open host' msg, but my server is still running & the previosuly connected clients are still receiving handshake.
Waited for few hours, still can't connect to server, do anyone know the possible reason why this is happening? this is killing me!
Thank you
Rove
|
|
|
|