Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Skin Framework
  New Posts New Posts RSS Feed - CFile::Open flags in LoadFromFile
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CFile::Open flags in LoadFromFile

 Post Reply Post Reply
Author
Message
VitVal View Drop Down
Newbie
Newbie


Joined: 14 March 2009
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote VitVal Quote  Post ReplyReply Direct Link To This Post Topic: CFile::Open flags in LoadFromFile
    Posted: 25 September 2009 at 7:24pm
The CXTPGraphicBitmapPng::LoadFromFile has such code:
/---
 CFile file;
 if (!file.Open(lpszFileName, CFile::modeRead))
 {
  return FALSE;
 }
---/
The code can result in failing to load an image if two instanses of a program will try to open the file.
I think you should change flags for CFile::Open
/---
  CFile file;
  if (! file.Open(lpszFileName, CFile::modeRead | CFile::shareDenyWrite))
 {
  return FALSE;
 }
---/
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.125 seconds.