|
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
|
|
|
|
|
from your description, I could understand that, it is the maximum number of clients that can be connected to the server.
Disconnect one of the currently connected clients and connect the new client. it should work fine.
SaRath.
"Do Next Thing..."
My Blog | Understanding State Pattern in C++
|
|
|
|
|
If this happens after a number of disconnects, you may be exhausting your socket handles. I would double-check your code to make sure that you are correctly freeing socket handles.
I have had this happen in the past with a UDP-based server I wrote - a bug in my socket wrapper class prevented the underlying socket handle from being released when the wrapper class was returned to its cache. (Note that in my case, the CPU usage was pegged when this happened, so if you are seeing that, that may be the problem.)
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
Hi James,
Your answer probably looks closer to my problem, thanks for your reply. Did you mean that i've to double check the socket handles in server appln? it is a tcp based server.
Rove
|
|
|
|
|
Yes, in the server app. When a client disconnects, make sure that you are calling closesocket(...) on the socket handle you were communicating on (or that whatever wrappers you are using are doing that).
The normal flow of operations should be something like:
SomeSocket = socket(...)
bind( SomeSocket, ... )
listen( SomeSocket, SOMAXCONN )
while( ClientConn = accept( SomeSocket, ... ) != INVALID_SOCKET )
{
closesocket( ClientConn )
}
closesocket( SomeSocket )
The above kinds-sorta-pesudo-code gives a simple idea.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
i am using MFC appwizard dialog based. how to define global variable
prashant jain malviya national institute of technology
-- modified at 6:26 Monday 26th June, 2006
|
|
|
|
|
go to the top of any cpp file, declare the variable there after the #include directive...
nave
|
|
|
|
|
my variable is fedit i have generated a tab sheet in mfc dialog based its showing an error
error C2086: 'fedit' : redefinition
prashant jain malviya national institute of technology
|
|
|
|
|
|
where did u declared the variable?
and r u sure u have declared it only once? please make a search for the string " fedit " in ur project for any other delcaration.
nave
|
|
|
|
|
In one of your source files, below #include stdafx.h , declare the global variable like this:
<br />
int GlobalInt;<br />
char GlobalCharArray[200];<br />
In the other source files, declare them like this (to tell the copmpiler/linker that they are declared somewhere else):
<br />
extern int GlobalInt;<br />
extern char GlobalCharArray[200];<br />
That's it.
|
|
|
|
|
if ur going to declare a variable in the header file and if that header is included from more than one cpp file, u will surely get the error LNK2005.
my suggestion is, u move the delclaration to stdafx.cpp .
nave
|
|
|
|