Results 1 to 3 of 3

Thread: CreateFile API function

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2002
    Location
    Russia
    Posts
    6

    CreateFile API function

    Did Anybody use API function CreateFile in VB ?
    I have problem with SECURITY_ATTRIBUTES parameter. I don't know what send in this function instead of that structure.

    fHandle = CreateFile( FileName, GENERIC_READ, FILE_SHARE_READ, ByVal CLng(0), OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)

    Like this don't work, return fHandle = -1
    Please help with example.

  2. #2
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    I pass null with "ByVal 0&".
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

  3. #3
    Software Eng. Megatron's Avatar
    Join Date
    Mar 1999
    Location
    Canada
    Posts
    11,286
    You could even avoid having to include that in your declaration by passing the argument as "Any" rather than "SECURITY_ATTRIBUTE"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width