why my map is getting failed when i can succesfully create a file,
i want the map for the file the "fname" specified in createfile please help me what can be the reason please provide me some solution.

BTW, since this question is clearly Windows specific (because you're talking about Windows API functions), you should be posting it in the Windows Programming forum instead of the general C++ forum. Just to keep things more organized and get the right kind of help.

"I am probably the laziest programmer on the planet, a fact with which anyone who has ever seen my code will agree." - esbo, 11/15/2008

"the internet is a scary place to be thats why i dont use it much." - billet, 03/17/2010

I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.

Problem with creartedFilemapping

dear Experts,
sorry that i might have posted in the wrong forum,
but please tell me the solution to my problem,
if i remove the casts also the createFileMapping() is getting failed,
please tell me what is wrong because i used many examples to test ,
but there was not output please tell me what to do,

You couldn't have found any examples like that, since as Salem points out it takes six arguments not five. (The last being "optional" only means you can pass in 0/NULL, not that you can pass in nothing at all.) Also, MAPPROTWRMODE is not listed as a valid value for the third value. (Actually, it looks like you're trying to make "_fileSize" play the part of the fourth and fifth arguments together.)