Click here to Skip to main content
15,914,013 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Closing an application while it is still busy Pin
cv_k3n28-Jul-06 4:21
cv_k3n28-Jul-06 4:21 
GeneralRe: Closing an application while it is still busy Pin
Eytukan28-Jul-06 7:47
Eytukan28-Jul-06 7:47 
GeneralRe: Closing an application while it is still busy Pin
cv_k3n28-Jul-06 17:03
cv_k3n28-Jul-06 17:03 
QuestionRe: Closing an application while it is still busy Pin
David Crow28-Jul-06 5:00
David Crow28-Jul-06 5:00 
Questiondynamically allocted array question Pin
kitty528-Jul-06 1:22
kitty528-Jul-06 1:22 
AnswerRe: dynamically allocted array question Pin
Cedric Moonen28-Jul-06 1:31
Cedric Moonen28-Jul-06 1:31 
GeneralRe: dynamically allocted array question Pin
Steen Krogsgaard28-Jul-06 1:39
Steen Krogsgaard28-Jul-06 1:39 
GeneralRe: dynamically allocted array question Pin
kitty528-Jul-06 2:08
kitty528-Jul-06 2:08 
Cedric Moonen wrote:
If you want to append it, you'll have to increment the address (something like buff+Offset). But warning !! As your buffer is a ULONG, it means that a single increment will point to the next ULONG (so 4 bytes further). It is not a good idea in this case to use a pointer to ULONG, use a pointer to UCHAR instead so you don't have to cast the pointer to a char area in order to be able to increment only one byte.


Ok so I do:
<br />
#define BUFF_SIZE = 0X400;<br />
ULONG numBytesRead = 0, offset = 0;<br />
UCHAR *buff = null;<br />
buff = new UCHAR[45000000];<br />
while(...)<br />
{<br />
   ReadFile(hndlPciAlt, buff, BUFF_SIZE, numBytesRead, NULL); //DMA data xfer<br />
}<br />

how would I pass the offsetted buff address in the while loop?
(i.e. buff + numBytesRead)
Since, every time I got into the loop it will be buff then buff + numBytesRead then buff + numBytesRead + numBytesRead, ... etc.
can I:
<br />
#define BUFF_SIZE = 0X400;<br />
ULONG numBytesRead = 0, offset = 0;<br />
UCHAR *buff = null;<br />
buff = new UCHAR[45000000];<br />
while(...)<br />
{<br />
   ReadFile(hndlPciAlt, (buff + offset), BUFF_SIZE, numBytesRead, NULL); //DMA data xfer<br />
   offset += numBytesRead;<br />
}<br />


Is (buff + offset) the proper syntax to increment the address of buff?

Thanks. Big Grin | :-D

Kitty5

GeneralRe: dynamically allocted array question Pin
Cedric Moonen28-Jul-06 2:15
Cedric Moonen28-Jul-06 2:15 
GeneralRe: dynamically allocted array question Pin
kitty528-Jul-06 2:26
kitty528-Jul-06 2:26 
AnswerRe: dynamically allocted array question Pin
Steen Krogsgaard28-Jul-06 1:39
Steen Krogsgaard28-Jul-06 1:39 
GeneralRe: dynamically allocted array question Pin
Cedric Moonen28-Jul-06 1:44
Cedric Moonen28-Jul-06 1:44 
GeneralRe: dynamically allocted array question Pin
Steen Krogsgaard28-Jul-06 1:52
Steen Krogsgaard28-Jul-06 1:52 
GeneralRe: dynamically allocted array question Pin
Cedric Moonen28-Jul-06 1:55
Cedric Moonen28-Jul-06 1:55 
AnswerRe: dynamically allocted array question Pin
Zac Howland28-Jul-06 4:58
Zac Howland28-Jul-06 4:58 
QuestionList Control Help need it........................................ Pin
konstantinos_100028-Jul-06 1:08
konstantinos_100028-Jul-06 1:08 
AnswerRe: List Control Help need it........................................ Pin
Naveen28-Jul-06 1:29
Naveen28-Jul-06 1:29 
GeneralRe: List Control Help need it........................................ Pin
konstantinos_100028-Jul-06 5:22
konstantinos_100028-Jul-06 5:22 
GeneralRe: List Control Help need it........................................ Pin
Naveen28-Jul-06 18:47
Naveen28-Jul-06 18:47 
QuestionRe: List Control Help need it........................................ Pin
Hamid_RT28-Jul-06 1:50
Hamid_RT28-Jul-06 1:50 
AnswerRe: List Control Help need it........................................ Pin
konstantinos_100028-Jul-06 2:31
konstantinos_100028-Jul-06 2:31 
GeneralRe: List Control Help need it Pin
Hamid_RT28-Jul-06 3:41
Hamid_RT28-Jul-06 3:41 
GeneralRe: List Control Help need it Pin
konstantinos_100028-Jul-06 5:23
konstantinos_100028-Jul-06 5:23 
GeneralRe: List Control Help need it Pin
Hamid_RT28-Jul-06 6:11
Hamid_RT28-Jul-06 6:11 
QuestionSir, Windows allots 4 GB space for Proccess can you tell me Pin
CodeVarma28-Jul-06 0:42
CodeVarma28-Jul-06 0:42 

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.