|
if he doesn't know the answer, why would he overload the servers ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Vivekuniq wrote:
u r there but "not" luking at my problem.
Yeah i looked at your problem, But when I see Tox already given you the answer, So i think there is no need of redundancy .
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
toxcct wrote:
if he doesn't know the answer
Usually I don't answer when somebody already given the answer
toxcct wrote:
why would he overload the servers ?
, Hain Tox i would be working On VC Forum Q&A 5 now (i.e. 2 and 3 is on you).
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
ThatsAlok wrote:
On VC Forum Q&A 5 now
ok... i'm on a now project at work, but i'm doing my best to mix everything in time...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Hi,
I downloaded a sample mfc project that builds and runs fine. But when I add any ActiveX control on one of the forms, it fails to start. What could be the problem?
Emmanuel Mwesigwa @ Mwemat
|
|
|
|
|
Could it be that the ActiveX control has not been registered? You can confirm this by ensuring that the dialog has the DS_NOFAILCREATE style.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
Hi all.
I have a dialog, that is a plugin for another application.
The problem is that my dialog works nice when i launch it from the other application, except TASB navigation and shortcuts.
When i test the dialog from Layout->Test, the TAB navigation works nice, but when i try to use tab navigation from my dialog launched from the host application i am not able to navigate with the TAB key.
In addition accelerators keys don't work with my dialog.
Any clues, maybe i have to explicitely get the TAB control? how can i do this?
Thanks
|
|
|
|
|
Could it be that the other application is trapping (e.g., not processing) the tab key such that your dialog does not see it?
lisux wrote:
Any clues, maybe i have to explicitely get the TAB control?
A tabbed dialog box (i.e., property sheet) has nothing to do with using the tab key to navigate controls on a dialog.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
This is a sign that the other application is not calling IsDialogMessage, to give your dialog a chance to process 'dialog messages' like accelerators and tab keys between controls. Perhaps because it does not know that a dialog is up on the screen?
If the other application has a custom message loop, check it to make sure it at least does TranslateMessage() and DispatchMessage, but the handling you are missing is definitely performed by the IsDialogMessage call.
|
|
|
|
|
Hi!
My problem is that when i move my application to another machine it doesn't work. The problem is with the links. I have a very simple cdhtmldialog dialog and here is its html resource. it contains two frames and i want to load a file to each one of them. Everything works fine on my computer, but when i deploy the application links stop working. How i fix this links...i tryid src="file:///juqu.htm", src="juqu.htm", src="./juqu.htm",... and much more...but nothing works...The html file that i want to load is in release directory with .exe file. thax for the help.
<title>A simple frameset document
<P>This frameset document contains:</p>
hussein
|
|
|
|
|
|
i'm using winsock.h for a simple c/s program.. in that, when i close the client.. the server is getting into a loop.. which keeps on prints the value previously received from the client...
how to handle the exception? i used try{ } catcb{} but i'm not sure it's in its correct form!.. plz help
Thanks,
V
|
|
|
|
|
if you are coding in C++, the try / catch statement is the right one (as refered by the MSDN[^])
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
while(1)
{
try
{
// this->recvSock();
bytesRecv = recv( m_socket, recvbuf, 5, 0 );
AfxMessageBox(recvbuf);
m_TEXT.AddString(recvbuf);
}
catch(CException* e)
{
// AfxMessageBox("Error");
// e->ReportError();
break;
}
}
//the above is given inside a worker thread.. simple one . works fine as the long as the client is alive.. goes mad when its closed.. loves client too much ??
Thanks
V
|
|
|
|
|
Vivekuniq wrote:
loves client too much ??
maybe...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
I'm not too sure about exceptions when it comes to winsock stuff, but try adding a check for bytesRecv == 0, and if so break:
if ((bytesRecv = recv(m_socket, recvbuf, 5, 0)) == 0)<br />
break;<br />
else<br />
....
If the other end of the link disconnects cleanly then recv should return 0 (zero bytes received). You would then, in the server, go back to a listen state waiting for a new connection. The reason you're printing out the last thing the server recieved over-and-over is because, as there's nothing to recv the buffer doesn't get overwritten.
Of course, this is all assuming you're using a connection oriented socket (TCP).
In theory the exception should pick up on the dropped connection, but as I say, I've not used exceptions with winsock comms.
Hope that's:
a) correct
b) helpful
Cheers, 'bod
|
|
|
|
|
icabod wrote:
I've not used exceptions with winsock comms.
Which is very bad programming practice. <slaps wrist>
|
|
|
|
|
instead of 0 if we check for -1 its working fine... i can trap it..
thanks,
V
|
|
|
|
|
Like I said, I've not used exceptions with winsock, so I'm not sure what it would catch. The recv will return 0 for a cleanly-disconnected socket, and -1 for some other error. I would have thought that the exception would catch the -1 case, leaving you to handle just the clean closure of the client.
But hey, if it works, it works
'bod
|
|
|
|
|
hey buddy great man.. its working.. thanks a lot..
its Correct and its Helpful so thanx,thanx,thanx,thanx,thanx,thanx,
V
|
|
|
|
|
yes it will loop indefinately even if the client gets disconnected as catch() is not executed after the client is disconnected(ie.,bytesRecv =0).put the try catch on return value from recv.
|
|
|
|
|
sunit5 wrote:
put the try catch on return value from recv.
?? return value can trow an Exception? r u sure? i'll try that too
V
|
|
|
|
|
tssss,
try / catch statement is used ONLY to catch thrown exceptions.
if no exception is thrown, you will never enter the bloc.
if you want to perform certain action depending a function result, just test it the simple way.
Vivekuniq wrote:
return value can trow an Exception?
no. but the function which is call and suspected to return a value can not execute well to its end and throw an exception before the return instruction.
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
in java we have a particular Exception thrown when it finds the client is disconnected..just like
try
{
}
catch(UnknownHostExeption e)// not sure some other exception here
{
}
do we have something like that in C++ (winsock)..?
Thnx
V
|
|
|
|
|
that what i tried to explain u waht toxxct said.dont put try and catch.better use if and else(test by yourself).msdn has mentioned if any exception thrown by an API
|
|
|
|