|
Use EmptyUndoBuffer() .
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
I know of that, but what if before I call SetWordCharFormat the user has an operation that is undoable. If I called EmptyUndoBuffer, they would be unable to undo that operation they had "done" before I called SetWordCharFormat. There's got to be a solution
|
|
|
|
|
Hi!
I am trying to create a chat application using the async socket mode ( I dont need more than 20 connections at a time so I didnt use overlapped mode).
My chat program has a server and clients connected to it. The server returns to all clients the messages sent by a client and all the clients view the same message.
The problem is that my chat server can resend a message which came from a client to only one client... I think I made a mistake in the FD_ACCEPT message:
<br />
case FD_ACCEPT:<br />
{<br />
sockaddr_in remoteAddr;<br />
int iRemoteAddrLen;<br />
iRemoteAddrLen = sizeof(remoteAddr);<br />
hRemoteSocket = accept(hSocket, (sockaddr*)&remoteAddr, &iRemoteAddrLen);<br />
}<br />
break;<br />
This code accepts all incoming clients but only lets me communicate with just one ! How can I communicate with more clients ?(Do I have to create a new socket for all new clients? )
Thank you very much for your future answers!
Well... I am a beginner ...
|
|
|
|
|
You may have to keep a reference to all the client sockets that is connected to your server sockets. You can use an array / list of socket descriptors for this.
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
|
|
|
|
|
Scolinks wrote:
How can I communicate with more clients ?(Do I have to create a new socket for all new clients? )
Indeed you do. The socket you initially create on your server is just used to accept new connections from clients. When you call accept it will return a socket which you use to communicate with that client. You'll need to keep track of all sockets created by th accept fn.
Phil
|
|
|
|
|
OK! Thanks a lot! I'll try to figure out how I can create a socket array!
Well... I am a beginner ...
|
|
|
|
|
I want my program to run an additional shell command.
I see function:
int system(const char* command);
It can execute command, but I cannot get the result of the command.
Is there any function that can execute command and recieve its result in some parameter? If not, I want any idea to get the result after the command is executed.
(I develop my program on Linux.)
|
|
|
|
|
Use either CreateProcess() or ShellExecute() instead.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
A better approach would be to use redirection. You can redirect the output of a command to a file. It should work irrespective of the platform used.
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
|
|
|
|
|
i dont know what this visual c++ is and what it does but i cant run my java with it.. it says see visual c++ documention for help on assertion failure, but.. god.. i can only turn on the damn computer! please help me someone
|
|
|
|
|
|
You can begin by reading through this document[^].
After you did understand this, I you can come back and I'll give you some excercises to improve your understanding.
Nice troll, thank you very much
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
Try the VB forum - they might not be able to help you, but they can certainly sing along with you
Phil
|
|
|
|
|
lol
I Dream of Absolute Zero
|
|
|
|
|
Honestly, I go crazy soon...
I'm trying to remotely debug an application, both PCs are connected trough LAN. I have all the correct .pdb files along with the dlls, but when there is an assert or a breakpoint, I can't see the source code, only assembler, and on the context call stack I have only hex numbers.
I don't know how to make this thing work...
Are there any tips and tricks to know to efficiently use remote debugger ?
Regards
Daniel
|
|
|
|
|
You might be working on the release version. Check it out!!!
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
|
|
|
|
|
I'm working with the debug version, and all my dlls are debug dlls aswell, all compiled with debug-info and program database activated.
Any other clue?
I only have the source code visible on the main project, if the call goes into a dll, i get only assembler...
|
|
|
|
|
You can try this.
If you have the source codes for the dll, you can probably start debugging that dll code by specifying the EXE name ( you already have that!!! Right ) in Project->Settings->Debug->"Executable for Debug Session".
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
|
|
|
|
|
Is the same source code on both sides? For remote debugging I run my project off a network drive so both sides have the same exact setup.
John
|
|
|
|
|
Hi again !
I'm using Visual Studio 6, and I have a problem with the editor that I never understood. When I'm in the .cpp file of a class and want to jump to a specific method, I use the listbox on the toolbar (this listbox is displaying all the methods of my class) and click on the one I want to jump to.
But, for some methods, the editor is not able to reach it and I get this error message :
'Cannot find the definition for this function. Classview cannot find functions definitions until they are saved at least once.'
Well, I did save them ! Some of the method of the class can be found, others cannot....
Any idea why and how to correct this problem ?
Thanks !
Jerome
|
|
|
|
|
I think the ide havenot create browse file for workspace.
rebuild it,and cover cursor on the mothed, press F12,you can reach to
where it definited.
dupengfei
|
|
|
|
|
I already tried what you said, but the problem remains !
Jerome
|
|
|
|
|
Hi Jerome,
Sometimes the ClassWizard gets out of sync or corrupt for some reasons I don't know of. It's a common problem but the suggested solution is always the same: rebuilding the ClassWizard files.
Simply delete your .clw and .opt files and bring up ClassWizard again and it should tell you "The ClassWizard database <path> does not exist. Would you like to build it from your source files?". Answer "Yes" in that dialog and a new dialog appears where you can select additional files outside the project. The files in your project are already added but if you have external files that you want to add to your ClassWizard database you should add them through this dialog.
Click "OK" and your problem should be gone.
Hope this helps
--
Rog
|
|
|
|
|
Hi everyone,
How can I convert a WCHAR array to an STL string. I am using the FILE_NOTIFY_INFORMATION structure which has a WCHAR parameter as Filename (not null terminated) and a long as FileLength. Now I want to convert this WCHAR array to a STL string. Any suggestions on how to do it would be really appreciated.
Pankaj
Without struggle, there is no progress
|
|
|
|
|