Click here to Skip to main content
15,887,027 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to Copy static array to dynamic array Pin
Albert Holguin5-Oct-11 3:33
professionalAlbert Holguin5-Oct-11 3:33 
GeneralRe: How to Copy static array to dynamic array Pin
Stephen Hewitt5-Oct-11 5:08
Stephen Hewitt5-Oct-11 5:08 
GeneralRe: How to Copy static array to dynamic array Pin
Code-o-mat5-Oct-11 5:14
Code-o-mat5-Oct-11 5:14 
AnswerRe: How to Copy static array to dynamic array Pin
«_Superman_»5-Oct-11 4:55
professional«_Superman_»5-Oct-11 4:55 
GeneralRe: How to Copy static array to dynamic array Pin
002comp6-Oct-11 17:53
002comp6-Oct-11 17:53 
QuestionCheck if an document is already open Pin
_Flaviu4-Oct-11 21:01
_Flaviu4-Oct-11 21:01 
AnswerRe: Check if an document is already open Pin
Richard MacCutchan4-Oct-11 21:41
mveRichard MacCutchan4-Oct-11 21:41 
AnswerRe: Check if an document is already open Pin
Software_Developer4-Oct-11 23:20
Software_Developer4-Oct-11 23:20 
Try and open it with CreateFile[^], specifying 0 (no sharing) for the dwShareMode parameter. If the file is already open, CreateFile will return INVALID_HANDLE_VALUE and GetLastError will return ERROR_SHARING_VIOLATION.

The code below will fail, printing the value of ERROR_SHARING_VIOLATION if the file a.a is already open.

C#
HANDLE f = CreateFile("a.a", GENERIC_READ|GENERIC_WRITE, 0, 0, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
   if (f == INVALID_HANDLE_VALUE)
   {
      std::cout << GetLastError() << std::endl;
      return 0;
   }



source: http://www.codeproject.com/Messages/3046449/Re-Check-file-is-open-or-not.aspx[^]
GeneralRe: Check if an document is already open Pin
_Flaviu4-Oct-11 23:35
_Flaviu4-Oct-11 23:35 
AnswerRe: Check if an document is already open Pin
App_4-Oct-11 23:32
App_4-Oct-11 23:32 
GeneralRe: Check if an document is already open Pin
_Flaviu4-Oct-11 23:40
_Flaviu4-Oct-11 23:40 
GeneralRe: Check if an document is already open Pin
Snorri Kristjansson4-Oct-11 23:56
professionalSnorri Kristjansson4-Oct-11 23:56 
AnswerRe: Check if an document is already open Pin
Snorri Kristjansson5-Oct-11 0:02
professionalSnorri Kristjansson5-Oct-11 0:02 
GeneralRe: Check if an document is already open Pin
_Flaviu9-Oct-11 6:52
_Flaviu9-Oct-11 6:52 
QuestionWindow or form clarification -nomenclature Pin
jkirkerx4-Oct-11 13:59
professionaljkirkerx4-Oct-11 13:59 
AnswerRe: Window or form clarification -nomenclature Pin
enhzflep4-Oct-11 18:56
enhzflep4-Oct-11 18:56 
GeneralRe: Window or form clarification -nomenclature Pin
jkirkerx5-Oct-11 6:21
professionaljkirkerx5-Oct-11 6:21 
AnswerRe: Window or form clarification -nomenclature Pin
ThatsAlok4-Oct-11 20:59
ThatsAlok4-Oct-11 20:59 
GeneralRe: Window or form clarification -nomenclature Pin
jkirkerx5-Oct-11 6:15
professionaljkirkerx5-Oct-11 6:15 
QuestionEntering ? into edit box Pin
Vaclav_4-Oct-11 12:28
Vaclav_4-Oct-11 12:28 
AnswerRe: Entering ? into edit box Pin
Richard Andrew x644-Oct-11 14:46
professionalRichard Andrew x644-Oct-11 14:46 
GeneralRe: Entering ? into edit box Pin
Vaclav_4-Oct-11 15:47
Vaclav_4-Oct-11 15:47 
GeneralRe: Entering ? into edit box Pin
Richard Andrew x644-Oct-11 15:50
professionalRichard Andrew x644-Oct-11 15:50 
GeneralRe: Entering ? into edit box SOLVED Pin
Vaclav_4-Oct-11 16:37
Vaclav_4-Oct-11 16:37 
GeneralRe: Entering ? into edit box SOLVED Pin
Richard Andrew x644-Oct-11 16:38
professionalRichard Andrew x644-Oct-11 16:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.