•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Pascal and Delphi section within the Software Development category of DaniWeb, a massive community of 402,955 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,841 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Pascal and Delphi advertiser: Programming Forums
Views: 745 | Replies: 8
•
•
Join Date: May 2008
Posts: 5
Reputation:
Rep Power: 0
Solved Threads: 0
I've developed a program that communicates with another program through anonymous pipes set up by the other program (not written by me).
The problem is that my program keeps crashing as soon as I add something more than just receiving the info. For example, if I add a simple "showMessage", it crashes, but works again if I remove it.
Here is the code:
Obviously the showMessage-instruction is just an example. If I try to do any parsing of the incoming text (for example sending it to a parser-function of some sort), it crashes. But the code above, devoid of anything extra, doesn't crash, and I can tell by the ouput in the memo that everything is received as expected (and sending info the other way works as well). So the communication is working.
I hear that buffering handled wrongly can cause problems (even crashing?). Is the input used by that read function using a buffer? And is the read function I'm using a real systems call or a part of Delphi (internally doing the systems call)?
My program has no previous history of crashing.
The problem is that my program keeps crashing as soon as I add something more than just receiving the info. For example, if I add a simple "showMessage", it crashes, but works again if I remove it.
Here is the code:
procedure TArena.read_winboard;
var text:string[50];
ch:char;
begin
while true do
begin
text:='';
repeat
read(input,ch);
text:=text+ch;
until ch=#10;
//showMessage('this instruction makes the program crash');
form1.memo1.Lines.Add(text);
end;
end;Obviously the showMessage-instruction is just an example. If I try to do any parsing of the incoming text (for example sending it to a parser-function of some sort), it crashes. But the code above, devoid of anything extra, doesn't crash, and I can tell by the ouput in the memo that everything is received as expected (and sending info the other way works as well). So the communication is working.
I hear that buffering handled wrongly can cause problems (even crashing?). Is the input used by that read function using a buffer? And is the read function I'm using a real systems call or a part of Delphi (internally doing the systems call)?
My program has no previous history of crashing.
•
•
•
•
•
•
•
•
DaniWeb Pascal and Delphi Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- Computer repeatedly crashing (Windows NT / 2000 / XP / 2003)
- Please Help C++ Connect four program due tonight by 12 (2) (C++)
- Program Crashing (C)
- Program keeps crashing... (C++)
- Program Crashing, security related? (Viruses, Spyware and other Nasties)
Other Threads in the Pascal and Delphi Forum
- Previous Thread: Urgent Help PLZ
- Next Thread: C++ to Delphi CheckSum code



Threaded Mode