Click here to Skip to main content
15,891,136 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionwhich module creates a specific file? Pin
Joseph Marzbani8-Sep-09 1:25
Joseph Marzbani8-Sep-09 1:25 
AnswerRe: which module creates a specific file? Pin
Garth J Lancaster8-Sep-09 1:52
professionalGarth J Lancaster8-Sep-09 1:52 
GeneralRe: which module creates a specific file? Pin
Joseph Marzbani8-Sep-09 3:00
Joseph Marzbani8-Sep-09 3:00 
AnswerRe: which module creates a specific file? Pin
Selvam R8-Sep-09 2:02
professionalSelvam R8-Sep-09 2:02 
AnswerRe: which module creates a specific file? Pin
Stuart Dootson8-Sep-09 3:39
professionalStuart Dootson8-Sep-09 3:39 
AnswerRe: which module creates a specific file? Pin
kilt10-Sep-09 6:36
kilt10-Sep-09 6:36 
QuestionRe: which module creates a specific file? Pin
David Crow14-Sep-09 3:50
David Crow14-Sep-09 3:50 
QuestionVC++ pointers with Readfile function [modified] Pin
GC1048-Sep-09 1:19
GC1048-Sep-09 1:19 
I am learning to use VS2005 to create a VC++ MFC project to read from the serial port using the 'ReadFile' function. in particular I am having problems getting the code to compile 'ReadFile' parameter 4:

h-file
...
DWORD ActualBytesRead
DWORD * pActualBytesRead
...

cpp-file

attempt 1:
pActualBytesRead = &ActualBytesRead
ReadFileStatus = ReadFile(SerialPortHandle, &ReceiverBuffer, NumberOfBytes2Read, pActualBytesRead, NULL)
-compiles, but parameter 4 ends up with 0xbaadF00d at the time of the 'ReadFile' call?

attempt 2:
ReadFileStatus = ReadFile(SerialPortHandle, &ReceiverBuffer, NumberOfBytes2Read, &ActualBytesRead, NULL)
-compiles (passing by reference?)

attempt 3:
pActualBytesRead = &ActualBytesRead
ReadFileStatus = ReadFile(SerialPortHandle, &ReceiverBuffer, NumberOfBytes2Read, *pActualBytesRead, NULL)
-won't compile?

OK, so I have a version of code that compiles but I don't really understand why attempt 1 & 3 fail?

modified on Tuesday, September 8, 2009 11:06 AM

AnswerRe: VC++ pointers with Readfile function Pin
«_Superman_»8-Sep-09 1:27
professional«_Superman_»8-Sep-09 1:27 
GeneralRe: VC++ pointers with Readfile function Pin
Cedric Moonen8-Sep-09 3:26
Cedric Moonen8-Sep-09 3:26 
AnswerRe: VC++ pointers with Readfile function Pin
David Crow8-Sep-09 3:05
David Crow8-Sep-09 3:05 
GeneralRe: VC++ pointers with Readfile function Pin
GC1048-Sep-09 4:48
GC1048-Sep-09 4:48 
GeneralRe: VC++ pointers with Readfile function Pin
David Crow8-Sep-09 4:56
David Crow8-Sep-09 4:56 
GeneralRe: VC++ pointers with Readfile function Pin
GC1048-Sep-09 5:06
GC1048-Sep-09 5:06 
QuestionGet current position of pointer using IStream interface Pin
MrKBA8-Sep-09 1:16
MrKBA8-Sep-09 1:16 
AnswerRe: Get current position of pointer using IStream interface Pin
Stuart Dootson8-Sep-09 3:43
professionalStuart Dootson8-Sep-09 3:43 
GeneralRe: Get current position of pointer using IStream interface Pin
MrKBA9-Sep-09 0:19
MrKBA9-Sep-09 0:19 
GeneralRe: Get current position of pointer using IStream interface Pin
Stuart Dootson9-Sep-09 3:20
professionalStuart Dootson9-Sep-09 3:20 
QuestionSome C++ Concepts Pin
hrishiS8-Sep-09 1:07
hrishiS8-Sep-09 1:07 
AnswerRe: Some C++ Concepts Pin
«_Superman_»8-Sep-09 1:12
professional«_Superman_»8-Sep-09 1:12 
GeneralRe: Some C++ Concepts Pin
hrishiS8-Sep-09 1:16
hrishiS8-Sep-09 1:16 
GeneralRe: Some C++ Concepts Pin
Cedric Moonen8-Sep-09 1:21
Cedric Moonen8-Sep-09 1:21 
GeneralRe: Some C++ Concepts Pin
hrishiS8-Sep-09 1:27
hrishiS8-Sep-09 1:27 
GeneralRe: Some C++ Concepts Pin
Cedric Moonen8-Sep-09 1:35
Cedric Moonen8-Sep-09 1:35 
GeneralRe: Some C++ Concepts Pin
N a v a n e e t h8-Sep-09 1:28
N a v a n e e t h8-Sep-09 1:28 

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.