Click here to Skip to main content
15,393,124 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Strange Font Problem in Edit Control Pin
vishalgpt1-Jun-11 22:04
Membervishalgpt1-Jun-11 22:04 
GeneralRe: Strange Font Problem in Edit Control Pin
ShilpiP1-Jun-11 22:46
MemberShilpiP1-Jun-11 22:46 
GeneralRe: Strange Font Problem in Edit Control Pin
vishalgpt1-Jun-11 23:33
Membervishalgpt1-Jun-11 23:33 
GeneralRe: Strange Font Problem in Edit Control Pin
ShilpiP2-Jun-11 0:29
MemberShilpiP2-Jun-11 0:29 
AnswerRe: Strange Font Problem in Edit Control Pin
Rajesh R Subramanian2-Jun-11 5:45
professionalRajesh R Subramanian2-Jun-11 5:45 
QuestionVirualAlloc and ReadFile Pin
csrss1-Jun-11 8:33
Membercsrss1-Jun-11 8:33 
AnswerRe: VirualAlloc and ReadFile Pin
Rajesh R Subramanian1-Jun-11 8:52
professionalRajesh R Subramanian1-Jun-11 8:52 
GeneralRe: VirualAlloc and ReadFile Pin
csrss1-Jun-11 9:10
Membercsrss1-Jun-11 9:10 
Yep, you are right. But here with this stuff i got more and more problems. For example, i cannot return bytes from function, (this code is a function, which should read a file into BYTE array and return this array among with nr of bytes read).

BYTE *ReadBytes(HANDLE hDevice, LPDWORD lpdwBytesRead)
{
	SIZE_T BASE_BUFFER_SIZE = 512;

	BYTE * bInitialBuffer = NULL;
	bInitialBuffer = (BYTE *)VirtualAlloc(0, 
			BASE_BUFFER_SIZE, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);

	if(bInitialBuffer == NULL)
	{
		// handle this sh*t
		TRACE("VirtualAlloc failed!");
		return NULL;
	}
	DWORD dwReadBytes;
	while (FALSE != ReadFile(hDevice, bInitialBuffer, BASE_BUFFER_SIZE, 
		(LPDWORD)&dwReadBytes, 0) && dwReadBytes > 0)
	{
		TRACE1("got some buffer! %d", dwReadBytes);
		lpdwBytesRead += dwReadBytes;
	}
	return bInitialBuffer;
}


and if i call it:

DWORD read = 0;
BYTE *DataBuffer = ReadBytes(hFile, &read);


read is always zero, and i got no bytes returned from function... And i cannot use just defined size (skip memory allocation).
Help ;(
011011010110000101100011011010000110100101101110
0110010101110011

GeneralRe: VirualAlloc and ReadFile Pin
Rajesh R Subramanian1-Jun-11 9:20
professionalRajesh R Subramanian1-Jun-11 9:20 
GeneralRe: VirualAlloc and ReadFile Pin
csrss1-Jun-11 9:50
Membercsrss1-Jun-11 9:50 
GeneralRe: VirualAlloc and ReadFile Pin
Rajesh R Subramanian1-Jun-11 10:18
professionalRajesh R Subramanian1-Jun-11 10:18 
AnswerRe: VirualAlloc and ReadFile Pin
Rajesh R Subramanian1-Jun-11 9:24
professionalRajesh R Subramanian1-Jun-11 9:24 
GeneralRe: VirualAlloc and ReadFile Pin
csrss1-Jun-11 10:01
Membercsrss1-Jun-11 10:01 
GeneralRe: VirualAlloc and ReadFile Pin
csrss1-Jun-11 10:08
Membercsrss1-Jun-11 10:08 
GeneralRe: VirualAlloc and ReadFile Pin
Rajesh R Subramanian1-Jun-11 10:19
professionalRajesh R Subramanian1-Jun-11 10:19 
GeneralRe: VirualAlloc and ReadFile Pin
csrss1-Jun-11 11:11
Membercsrss1-Jun-11 11:11 
QuestionRe: VirualAlloc and ReadFile Pin
David Crow1-Jun-11 10:10
MemberDavid Crow1-Jun-11 10:10 
AnswerRe: VirualAlloc and ReadFile Pin
csrss1-Jun-11 11:12
Membercsrss1-Jun-11 11:12 
Questionva_list not working form me and i dont know why Pin
kosacid1-Jun-11 5:19
Memberkosacid1-Jun-11 5:19 
AnswerRe: va_list not working form me and i dont know why Pin
Luc Pattyn1-Jun-11 5:51
sitebuilderLuc Pattyn1-Jun-11 5:51 
GeneralRe: va_list not working form me and i dont know why Pin
kosacid1-Jun-11 6:02
Memberkosacid1-Jun-11 6:02 
AnswerRe: va_list not working form me and i dont know why Pin
Luc Pattyn1-Jun-11 6:53
sitebuilderLuc Pattyn1-Jun-11 6:53 
GeneralOT Pin
CPallini1-Jun-11 8:14
mveCPallini1-Jun-11 8:14 
GeneralRe: OT Pin
Luc Pattyn1-Jun-11 13:59
sitebuilderLuc Pattyn1-Jun-11 13:59 
AnswerRe: va_list not working form me and i dont know why Pin
«_Superman_»1-Jun-11 6:01
professional«_Superman_»1-Jun-11 6:01 

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.