Re: Error with Memory Mapped File
- From: "<ctacke/>" <ctacke[@]opennetcf[dot]com>
- Date: Fri, 5 Jan 2007 09:25:11 -0500
Don't address posts to an individual - this is a newsgroup, not a chat room.
Error 183 (you should learn to look those up) is "Cannot create a file when
that file already exists." My guess is that the file is open by something
else that didn't give compatible sharing when it opened it.
--
Chris Tacke
OpenNETCF Consulting
Managed Code in the Embedded World
www.opennetcf.com
--
"Vinh Nguyen Van" <vinh2b@xxxxxxxxx> wrote in message
news:OBdezhLMHHA.2252@xxxxxxxxxxxxxxxxxxxxxxx
Dear Alex Yakhnin
I has downloaded your source code for Memory Mapped File.
I create a sample:
private static void Test(string fileName)
{
MemoryMappedFileStream mStream = new
MemoryMappedFileStream(fileName, "a", 64,
MemoryProtection.PageReadOnly);
byte[] bff = new byte[10];
mStream.Read(bff, 0, 10);
Console.WriteLine();
}
I debug from source code, I see that:
IntPtr hFile = MemoryMappedFileHelper.CreateFileForMapping(fileName,
Win32FileAccess.GENERIC_READ | Win32FileAccess.GENERIC_WRITE,
Win32FileShare.FILE_SHARE_READ | Win32FileShare.FILE_SHARE_WRITE,
IntPtr.Zero, Win32FileMode.OPEN_ALWAYS,
Win32FileAttributes.FILE_ATTRIBUTE_NORMAL, IntPtr.Zero);
uint lastError = MemoryMappedFileHelper.GetLastError();
lastError = 183
When I continue my app to get some bytes from mapped memory, my app
close automatically.
I develop on C#, NetFX 2.0, pocket pc 2003.
Help me please.
Thanks
*** Sent via Developersdex http://www.developersdex.com ***
.
- References:
- Error with Memory Mapped File
- From: Vinh Nguyen Van
- Error with Memory Mapped File
- Prev by Date: Re: WLAN Connections
- Next by Date: Re: CF 2.0 : How to exit the application from a separate thread ?
- Previous by thread: Error with Memory Mapped File
- Next by thread: Copying files from PDA to desktop and vice versa using a PDA application developed using vb.net
- Index(es):
Relevant Pages
|