CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Why

  1. #1
    Join Date
    Apr 1999
    Posts
    13

    Why

    Hi,

    I use C language and toto is binary file

    // Code A
    ProtFolioHnd = CreateFile ( FileName,
    GENERIC_READ|GENERIC_WRITE ,
    FILE_SHARE_READ,NULL,OPEN_EXISTING,
    FILE_ATTRIBUTE_NORMAL , NULL );
    if (ProtFolioHnd == INVALID_HANDLE_VALUE)
    { //Share violation
    char Buffer[80];
    _snprintf(Buffer,80,"%s : Is
    being used by another
    user.",FileName);
    // Code B
    ProtFolioHnd = CreateFile
    (FileName, GENERIC_READ, FILE_SHARE_READ,
    NULL,OPEN_EXISTING ,FILE_ATTRIBUTE_NORMAL, NULL );
    MessageBox ( GetActiveWindow(), Buffer,"Estimates Direct", MB_OK);
    }

    // the process A et B are the same application in different PC
    - If the process A open the file toto (binary file) // do the code A
    - The process B open the file toto (binary file) // do the code B. ProtFolioHnd== -1 Why ?


    Thanks



  2. #2
    Join Date
    Apr 1999
    Posts
    13

    Re: Why

    yyu


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

Featured