Solved

createfile problems

Posted on 1998-02-26
4
408 Views
Last Modified: 2013-12-04
   hFile:=createFile (
        nmFile, GENERIC_READ,
        FILE_SHARE_READ, nil, OPEN_EXISTING,
        FILE_ATTRIBUTE_NORMAL, FILE_FLAG_NO_BUFFERING
      );

      if hFile=INVALID_HANDLE_VALUE then
        raise eFileCopy.createLastError (
          'could not open source file '+sp+' to get it''s size.');

this results in an system error 50 ("the network request is not supported") for me on a windows 95 system, and no errors on NT (same filename). What am I doing wrong here?
0
Comment
Question by:lowlevel
  • 2
4 Comments
 
LVL 11

Expert Comment

by:alexo
ID: 1411572
And the value of nmFile is...
0
 
LVL 22

Expert Comment

by:nietod
ID: 1411573
Also have you tried it without NO_BUFFERING.  I know you want to avoid the overhead of buffering when you are just geting the file size, but there are a lot of restrictions associated with it and it could be causing a problem.  Its worht a try.
0
 
LVL 1

Accepted Solution

by:
hasmet earned 100 total points
ID: 1411574
HANDLE hTemplateFile (the last argument) must be NULL for win95.

0
 
LVL 22

Expert Comment

by:nietod
ID: 1411575
Oh I see the problem.  Hasmet is on the right track.  You have a comma where you want a "|" and you are missing the last parameter.
   Try
createFile (nmFile, GENERIC_READ,
FILE_SHARE_READ, nil, OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL | FILE_FLAG_NO_BUFFERING,
NULL);
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now