Click here to Skip to main content
15,884,629 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: WriteFileEx Pin
Luc Pattyn6-Jan-10 6:58
sitebuilderLuc Pattyn6-Jan-10 6:58 
GeneralRe: WriteFileEx (I have reposted with pre tags) Pin
noalias___6-Jan-10 7:05
noalias___6-Jan-10 7:05 
AnswerRe: WriteFileEx Pin
noalias___6-Jan-10 7:02
noalias___6-Jan-10 7:02 
GeneralRe: WriteFileEx Pin
Luc Pattyn6-Jan-10 7:12
sitebuilderLuc Pattyn6-Jan-10 7:12 
GeneralRe: WriteFileEx (with inditation) Pin
noalias___6-Jan-10 7:18
noalias___6-Jan-10 7:18 
GeneralRe: WriteFileEx (with inditation) Pin
Richard MacCutchan6-Jan-10 7:37
mveRichard MacCutchan6-Jan-10 7:37 
GeneralRe: WriteFileEx (with inditation) Pin
noalias___6-Jan-10 7:59
noalias___6-Jan-10 7:59 
AnswerRe: WriteFileEx [modified] Please help Pin
cmk6-Jan-10 15:40
cmk6-Jan-10 15:40 
1. Initialize all variables!
2. Use calloc if you aren't going to set the contents right away, or they will be set by another function.

e.g. Client - OpenPipe()
pPipeInst[PipeNumber] = (PPIPEINST) calloc (1, sizeof(PIPEINST));
Without this your first call to ReadFile will have random garbage in the overlapped structure which may cause it to fail or corrupt or hang.

3. you aren't using overlapped as intended. Your client main() spins on a non-blocking ReadPipe(). I expect that ReadFile() posts an overlapped read but doesn't finish, main calls again, pending still not done but tries to post another overlapped read using the same overlapped structure. This likely hoses the state of the first read and who knows what else. Easy fix: use GetOverlappedResult(..., TRUE) i.e. make it wait for the read to finish. Proper fix: Redo design to use overlapped properly.

...cmk

The idea that I can be presented with a problem, set out to logically solve it with the tools at hand, and wind up with a program that could not be legally used because someone else followed the same logical steps some years ago and filed for a patent on it is horrifying.
- John Carmack

QuestionDifferentiating 2 methods with the same name for a pointer Pin
Code-o-mat6-Jan-10 0:46
Code-o-mat6-Jan-10 0:46 
AnswerRe: Differentiating 2 methods with the same name for a pointer Pin
Richard MacCutchan6-Jan-10 2:12
mveRichard MacCutchan6-Jan-10 2:12 
GeneralRe: Differentiating 2 methods with the same name for a pointer Pin
Code-o-mat6-Jan-10 2:15
Code-o-mat6-Jan-10 2:15 
GeneralRe: Differentiating 2 methods with the same name for a pointer Pin
molesworth6-Jan-10 2:51
molesworth6-Jan-10 2:51 
GeneralRe: Differentiating 2 methods with the same name for a pointer Pin
Code-o-mat6-Jan-10 3:44
Code-o-mat6-Jan-10 3:44 
GeneralRe: Differentiating 2 methods with the same name for a pointer Pin
Richard MacCutchan6-Jan-10 3:36
mveRichard MacCutchan6-Jan-10 3:36 
GeneralRe: Differentiating 2 methods with the same name for a pointer Pin
Code-o-mat6-Jan-10 3:47
Code-o-mat6-Jan-10 3:47 
GeneralRe: Differentiating 2 methods with the same name for a pointer Pin
Richard MacCutchan6-Jan-10 3:55
mveRichard MacCutchan6-Jan-10 3:55 
AnswerRe: Differentiating 2 methods with the same name for a pointer Pin
SimonSays6-Jan-10 5:07
SimonSays6-Jan-10 5:07 
AnswerRe: Differentiating 2 methods with the same name for a pointer Pin
Moak6-Jan-10 15:30
Moak6-Jan-10 15:30 
GeneralRe: Differentiating 2 methods with the same name for a pointer Pin
Code-o-mat6-Jan-10 21:29
Code-o-mat6-Jan-10 21:29 
GeneralRe: Differentiating 2 methods with the same name for a pointer Pin
Moak7-Jan-10 0:32
Moak7-Jan-10 0:32 
QuestionDataBase Pin
jannathali5-Jan-10 22:38
jannathali5-Jan-10 22:38 
AnswerRe: DataBase Pin
_AnsHUMAN_ 5-Jan-10 23:09
_AnsHUMAN_ 5-Jan-10 23:09 
AnswerRe: DataBase Pin
«_Superman_»6-Jan-10 0:26
professional«_Superman_»6-Jan-10 0:26 
QuestionCapturing check/uncheck in checkbox in listcontrol Pin
itkid5-Jan-10 22:16
itkid5-Jan-10 22:16 
AnswerRe: Capturing check/uncheck in checkbox in listcontrol Pin
Naveen5-Jan-10 22:46
Naveen5-Jan-10 22:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.