Player playing large file .... Best way to manage memory

I am creating a player that will play a large file ... say 500MB. Are 
CreateFileMapping and MapViewOfFile API going to be useful ..... points to 
note...
1) I am only going to read the file.
2) The file will reside on the network shared path.
3) I am only going to read the file sequentially. (From start to end)

Plz let me know whether normal file APIs are enough or File mapping APIs 
..... or is there any other better solution ........ 


0
mubi (158)
2/13/2007 6:52:40 PM
vc.mfc 33608 articles. 0 followers. Follow

2 Replies
412 Views

Similar Articles

[PageSpeed] 28

Yes, they could work.  Note that you might want to have two views active, to provide some
"double-buffering".  But also, reading the file in large chunks (perhaps 5MB or so) would
also work.  I've done it from the local disk with only 32K of buffering, but on a shared
network path you might have long enough delays.  On second thought, the file mechanism
would be better in that case because the data would have to be "preloaded" into your
address space, whereas the file mapping would potentially take a lot of page faults to
bring the data in from the remote share.
					joe
On Tue, 13 Feb 2007 12:52:40 -0600, "Mubashir Khan" <mubi@yahoo.com> wrote:

>I am creating a player that will play a large file ... say 500MB. Are 
>CreateFileMapping and MapViewOfFile API going to be useful ..... points to 
>note...
>1) I am only going to read the file.
>2) The file will reside on the network shared path.
>3) I am only going to read the file sequentially. (From start to end)
>
>Plz let me know whether normal file APIs are enough or File mapping APIs 
>.... or is there any other better solution ........ 
>
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15974)
2/13/2007 8:11:52 PM
"Mubashir Khan" <mubi@yahoo.com> wrote in message 
news:OUvZ2A6THHA.920@TK2MSFTNGP05.phx.gbl...
>I am creating a player that will play a large file ... say 500MB. Are 
>CreateFileMapping and MapViewOfFile API going to be useful ..... points to 
>note...
> 1) I am only going to read the file.
> 2) The file will reside on the network shared path.
> 3) I am only going to read the file sequentially. (From start to end)
>
> Plz let me know whether normal file APIs are enough or File mapping APIs 
> .... or is there any other better solution ........

If you read the file only sequentially, sit in a loop, read a chunk, user 
it, then read the next chunk into the same memory and repeat until the 
complete file has been read.

-- David (MVP)


0
dc2983 (3206)
2/13/2007 8:14:57 PM
Reply:

Similar Artilces:

Run VB Script from a remote machine for SFTP file transfers
Hello, I need to use a scheduling utility to run a VB script that reside on a remote machine. The VB script will contain a couple of commands to send SFTP file transfers. Any one know how I can go about doing this? Any help will be appreciated. Thanks. ...

HDD unable to format in Storage Manager
Hi I am using wince 6.0 platform builder to mount hard disk. I am able to mount hard disk, but I could not format the drive, Also i could not see the content of the HDD when i tried with an already formated disk. whenever I Click the storage manager -> Dismount->Format, it shows message box "Unable to format store". I have attached my platform registry settings --------------------------------------------------------------------- [HKEY_LOCAL_MACHINE\Drivers\BuiltIn\PCI\Instance\genericide] "Prefix"="IDE" "Dll"="atapi.dll"...

Outlook 2002 SP3 Virtual Memory / Crashing problem
Hello, all. I have Outlook 2002 SP3 on my work laptop. (thus, upgrading is not an option.) I have recently broken out the .pst into multiple files, and run the outlook repair program against the main .pst file. Even before that I have had a problem where outlook, even sitting, will in a period of time (anywhere from 20 minutes to hours) will lock up. It will lock up the entire computer. A Virtual Memory is running low, making more box is presented, and eventually outlook will crash. Then the computer recovers. It can lock the computer up for 5 minutes. Any quick ideas? My main PST file is ra...

So is Outlook Express no longer best way to read/use NG?
If you use the MS provided web interface, you can filter & create by type; Question, Suggestion or Comment. Is everything posted from Outlook Express going to show up as a Comment instead of a Question? Seems like this should be the exact opposite; as I've seen more Questions than Comments! ...

Managing Mailboxes fail
Ok so here is the story, we have three exchange servers, two backend servers withing the same administrative group with two databases a piece. We also have on front end server hosting OWA. When a user is terminated we set up mailboxes to be forwarded and or managed. As of late the management of these mailboxes have not been workin. We typically disable the users, and do not touch the actual mailboxes. Set up forwarding so all mail that hits the disabled user is forwarded to an active user (this seems to work flawlessly), when we go into outllook to attach the additional mailbox it fails, w...

OWA2007 direct file server access lack of fine grained control?
Hi all, One of the new features of 2007 that we were really keen to implement was the ability for users to access their home directories via the web. However, it turns out that there is very little control in terms of restricting acccess to only specific file shares on a server? Let me explain properly... We have all our file shares(staff home dirs, student home dirs, corporate data, class materials) on a single file server. We only want to allow access to the staff home dirs via the web, but everything I've tried so far, including denying access to the mail server at both NTFS and...

Mailbox Manager Group Membership
I am trying to setup a mailbox manager policy in Exchange 2000 based on group membership of a distribution group "EmailRetention". When I setup my filter, I choose: General Tab: check off "Users with Exchange mailbox" Storage Tab: leave a default ("Mailboxes on any server") Advanced Tab: User Field: Group Membership; Condition: Starts with; Value: Email This returns nothing. However, if I set the Value to *, it returns all users. Can anyone recommend a better way to query based on group membership? Thanks in advance! Jeff ...

PPS Files
After reformatting my PC I can no longer open PPS files in my e-mails. I am running Win XP Pro and Microsoft Office 2003. I had no problems before this opening PPS files. Thank You Roy These are PowerPoint slides. Can you open them when yo save them first? -- Robert Sparnaaij [MVP-Outlook] www.howto-outlook.com Tips of the month: -Navigation Pane Tips & Tricks -Create an Office XP CD slipstreamed with Service Pack 3 ----- "Roy Lambell" <vb48@ozemail.com.au> wrote in message news:4beb01c473a5$dcb4c8d0$a501280a@phx.gbl... > After reformatting my PC I can no longer o...

Opening File in Excel from IE Shortcut
Excel 2003 I would like to have a shortcut in my IE list of Favorites that opens an Excel file *in* Excel. I created a shortcut to the Excel .EXE file and then tried adding the file name (with full path) to the end of that command, and I've played around with a few other things like changing the Start In value in the shortcut properties, but thus far I have not been able to make this work. The best I've been able to do is make Excel open to a blank worksheet, or to make my worksheet open in IE. But I can't get my worksheet to open in Excel from an IE Favorite. Can this ...

User Manager Login problem
Hi, I've just installed MS CRM 1.2. Everything works fine, however when I attempt to logon to the User Manager, I get the following error: "Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON." (80040e4d) Any ideas? Thanks in advance! Mike Mike, Did you go through the steps of assigning a license to the Admin user? Matt Parks ---------------------------------------- ---------------------------------------- On Fri, 16 Apr 2004 04:55:49 -0400, "mikieg_99" <mike.gallagher@etypemedia.co.uk> wrote: Hi, I've just installed MS CRM 1.2. Everything work...

import many text files
I have to import text files in Excel. I'd like to bypass the procedure of "lines to skip" and "Delimiter Selection" since it's always the same. Is there a way to tell Excel how to import a certain type of file (regarding the extention) and to do it without asking questions ? Thank you If your text files are comma delimitered, then changing the file extension to .csv rather that .txt will cause Excel to open your text file without going through the import wizard. >-----Original Message----- >I have to import text files in Excel. I'd like to bypas...

Transaction Manager error on E2K
Hi all, I'm copying in below an error from my event logs that I'm not familiar with. I did find an article on Technet about it but I don't think it "clicked" with me; I'm not really sure about the cause/resolution. Anyone who could shed some light on this would be greatly appreciated! Event Type: Error Event Source: ESE Event Category: Transaction Manager Event ID: 623 Date: 11/26/2004 Time: 10:55:46 AM User: N/A Computer: XXXXXXXXXXXXXXX Description: Information Store (4172) 8ddd4d57-28f4-47f5-af61-ef70224ef0a1: The version store for this instance (0) has reache...

how to save a file as ASCII: expanded comma delimited text (.exp).
How do I save and excel file as an .exp file, or as they requested an ASCII: expanded comma delimited text (.exp) ...

Inadequate Memory Problem
I was trying to cut and paste a few images into Word Perfect, and experienced a failure saying 'inadequate memory'. I have 2GB DDR in four 512MB segments. I wonder what the problem might be? Thanks Duke jw@eldorado.com wrote: > I was trying to cut and paste a few images into Word Perfect, and > experienced a failure saying 'inadequate memory'. I have 2GB DDR > in four 512MB segments. I wonder what the problem might be? The exact wording was "inadequate memory"? Yes - the exact wording is important here. The title of the window that ...

how can i customize the way office x looks?
hello everyone, i like entourage (and since i use a hotmail address on my os x mac, i don't think i have any other choice anyway) but i hate the look of the program. is there any possibility to have a text-only toolbar or to change those candy-colored icons into something a little more discreet-looking? internet explorer has different "themes" to suit what the rest of your system looks like, but I haven't found this feature in office x. how can i customize the way entourage looks? (and the other office x apps too, actually) thanks! Mdimm On 10/6/03 7:09 AM, in article 386...

Publisher cannot open files from a different version??????
A customer sent me a Publisher file created with Publisher 2000 v6.0. I have Publisher 2000 SP3. Why won't publisher open this file? Is it because I went to the trouble of installing the updates as MS suggested? Thanks for any help Do you have Norton? Disable "script blocking" and in Norton options, misc., disable "Office Plug-in." Disable any other anti-virus software and try opening the file. You could try opening it in safe mode, there is the chance the file is looking for a printer driver. -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps....

Access a excel file through FTP without write protection
hi ng I have made an excel application which is supposed to be a multi user application. I have placed the application in my libary on my web hotel, and it is supposed to be accessed by the users through FTP in Excel (where the users get the password and username). But when I try to access the file from Excel by FTP- I can open it - but it is write protected. When I go directly into my FTP-drive from the internet explorer and right click on the file - it shows that the file is NOT write protected - How can I access the file through Excel with FTP without the file is write protected. ...

SQL error in HQ Admin File Configuration.
Hi I have installed HQ Administrator, HQ Manager onto client PC. The HQ database has been set up int he server. In HQ Administrator, after I enter the server, log in id , password and database. I encountered SQL error "Error : 21472209999 Method '~' or object '~' failed (Source ADODB. coonection)" when I click "Test Database Connection". In HQ Administrator, if I click file -> Connect to same server and same database -> succesfully connected with no error. However, if I try to run a query such as "select * from item", the same error m...

System Manager Snap-In Issue
I am trying to add the System Manger Snap-In after installing the Exchange Admin Tools on my local workstation (WXP Sp2). I verified that the path was correct for the snap-ins based on a kb. All that appears in the list, are 2 exchange snap-ins that generate errors when you attempt to add them. Exchange System is the name of one of the snap-in, but only shows up as a folder, and will not add. If I browse to the Exchange System Manger from the Start menu, it runs just fine. Any ideas. Hi, I notice that you have submitted the same question before in this newsgroup and Windows.Gene...

repair of excel file
Hi everyone can direct me about repair an excel file. I can't afford to pay the program that download from the internet. Does anyone know any freeware that can repair my excel file thank you my email is tandrew@bigpond.net.au What error messages are you getting and what have you tried already? "Andrew Tan" <tandrew@bigpond.net.au> wrote in message news:scNZa.28549$bo1.27838@news-server.bigpond.net.au... : Hi everyone can direct me about repair an excel file. : I can't afford to pay the program that download from the internet. : : Does anyone know any freeware th...

Import file names
I am having nearly 5000 files in a folder and is it possible for me to just import the file names in to excel format from the particular folder. any help appreciated thanks in advance There's a couple of routines in this thread: http://groups.google.co.uk/group/microsoft.public.excel.misc/browse_frm/thread/18d89848f0726fb2/6d76a93c6e6b7fca?lnk=st&q=group:*excel*+insubject:%22Files+insubject:in+insubject:a+insubject:directory%3F%22+author:phillips&rnum=1&hl=en#6d76a93c6e6b7fca or http://snipurl.com/i03g S.G.Pillai wrote: > > I am having nearly 5000 files in a fol...

Displaying Images in reports
I have a table with a text field containing the path to an image file. I use this field in the detail of a report to display the relevant picture for that particular record via a line of code in the Format Detail event (use an Image Frame rather than a Bound or Unbound Frame). There are 70+ records / images. When I open the report for viewing, the first page (of 20 pages) displays ok, if a tad on the exceedingly slow side. If I try to go to the last page of the report (via the go to last page navigation button), there is a very long wait as the report 'attempts' to get to the l...

Large emails
Hi At the moment our emails are routed through a seperate server that has software installed on it that allows us to queue up large attachments and send them out of office hours. I have E2K SP3, I am going to migrate to E2K3 shortly and was hoping and wondering that E2K3 had this functionality built into it. Thanks Bob You can simply create an smtp connector and specify that. Not required to route through another server. -- Bharat Suneja MCSE, MCT -------------------------------- "bob smythe" <bob@aol.com> wrote in message news:O01PFKSvFHA.3500@TK2MSFTNGP09.phx...

Cannot find file. Check if libraries not missing
Hello, I'm sure this problem has come up before, but can't find it in archives :-(( How do I amend the situation where an Excel file (in fact, .XLS or .CSV) when double-clicked doesnt open, with a message: "File X...-{full path here} cannot be found. Check if all path and filename are OK and if all libraries are available" ?? The very same file opens OK from a "File -> Open" dialogue. I have this problem for a few days now and it began with an Excel crash. Win98 machine. I tried to look into Win98 file types/properties and it seems to be fine on that front. I ...

Electronic Reconcile Management
I have this client that is trying to implement Electronic Reconcile Management however upon setting up the 'ERM Import Setup' using the CSV file type I am required to add in a formula for the DATE field. I add the the length of the various fields and the DATE indicator in the window. Finally I click on the VERIFY button and to get a error message 'SETUP REPORTS'. The other formula fields work without incident. Submitted via EggHeadCafe - Software Developer Portal of Choice More Fun with Fluent NHibernate Automapping http://www.eggheadcafe.com/tutorials/aspnet/50aa9...