Click here to Skip to main content
15,888,968 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: copy exe file to remote system Pin
David Crow22-Jan-04 2:56
David Crow22-Jan-04 2:56 
QuestionBug in C++ ???? Pin
GDavy21-Jan-04 23:39
GDavy21-Jan-04 23:39 
AnswerRe: Bug in C++ ???? Pin
фил22-Jan-04 2:42
фил22-Jan-04 2:42 
GeneralNetworking on Windows 9x/ME Pin
YanezDeGomeyra21-Jan-04 23:01
YanezDeGomeyra21-Jan-04 23:01 
GeneralRe: Networking on Windows 9x/ME Pin
Mukkie25-Jan-04 8:16
Mukkie25-Jan-04 8:16 
Questionhow to make CButton with bgcolor and a icon Pin
angu selvam21-Jan-04 22:53
angu selvam21-Jan-04 22:53 
AnswerRe: how to make CButton with bgcolor and a icon Pin
wb22-Jan-04 0:04
wb22-Jan-04 0:04 
GeneralFindFirstChangeNotification Pin
Rob Caldecott21-Jan-04 22:32
Rob Caldecott21-Jan-04 22:32 
Interesting issue when using FindFirstChangeNotification and FILE_NOTIFY_CHANGE_FILE_NAME.

I have two threads. Every so often thread A creates a temp file and then uses the MoveFile API command to move the file to a specific folder. Thread B is watching said folder via FindFirstChangeNotification/FILE_NOTIFY_CHANGE_FILE_NAME. When the file appears in the folder, thread B wakes up and processes the file. However, on some PCs, thread B fails to open the file - GetLastError returns 32 - "File in use by another process". I can only imagine that thread B is getting FILE_NOTIFY_CHANGE_FILE_NAME mid-way through the MoveFile. Not sure what to do about this - keep trying to open the file until it succeeds? Tacky. Note I am only getting one FILE_NOTIFY_CHANGE_FILE_NAME notification - so I can't ignore it if the file open fails in the hope I will get another one later.

Stumped. I guess, as this is one app, thread A can call a therad-safe function in thread B and add the file to a list protected by a critical section or something, but this is a fair amount of re-engineering.

Anyone else come across issues like this with FindFirstChangeNotification?



The Rob Blog
GeneralRe: FindFirstChangeNotification Pin
Rob Manderson21-Jan-04 23:37
protectorRob Manderson21-Jan-04 23:37 
GeneralRe: FindFirstChangeNotification Pin
Rob Caldecott21-Jan-04 23:56
Rob Caldecott21-Jan-04 23:56 
GeneralRe: FindFirstChangeNotification Pin
Rob Manderson22-Jan-04 0:11
protectorRob Manderson22-Jan-04 0:11 
GeneralRe: FindFirstChangeNotification Pin
Rob Caldecott22-Jan-04 0:23
Rob Caldecott22-Jan-04 0:23 
GeneralRe: FindFirstChangeNotification Pin
Rob Manderson22-Jan-04 0:33
protectorRob Manderson22-Jan-04 0:33 
GeneralRe: FindFirstChangeNotification Pin
basementman22-Jan-04 12:08
basementman22-Jan-04 12:08 
GeneralRe: FindFirstChangeNotification Pin
Rob Manderson22-Jan-04 12:35
protectorRob Manderson22-Jan-04 12:35 
GeneralRe: FindFirstChangeNotification Pin
basementman23-Jan-04 4:21
basementman23-Jan-04 4:21 
GeneralRe: FindFirstChangeNotification Pin
Yogurt22-Jan-04 0:01
Yogurt22-Jan-04 0:01 
Questiontoolbar on CDialogBar??? Pin
Balkrishna Talele21-Jan-04 22:23
Balkrishna Talele21-Jan-04 22:23 
GeneralPlease help Pin
30jenny21-Jan-04 22:21
30jenny21-Jan-04 22:21 
GeneralRe: Please help Pin
Mukkie25-Jan-04 8:20
Mukkie25-Jan-04 8:20 
Generalopening a doc in IE Pin
Abhi Lahare21-Jan-04 22:19
Abhi Lahare21-Jan-04 22:19 
GeneralRe: opening a doc in IE Pin
alex.barylski21-Jan-04 22:45
alex.barylski21-Jan-04 22:45 
GeneralRe: opening a doc in IE Pin
22491722-Jan-04 0:48
22491722-Jan-04 0:48 
GeneralRe: opening a doc in IE Pin
Abhi Lahare22-Jan-04 17:57
Abhi Lahare22-Jan-04 17:57 
GeneralRe: opening a doc in IE Pin
22491722-Jan-04 23:51
22491722-Jan-04 23:51 

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.