Solved

createfile problems

Posted on 1998-02-26
4
416 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
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…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

635 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