Click here to Skip to main content
15,889,034 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
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 
I understand the reluctance to spawn yet another thread. The situation I found myself in was that our application processed a file and then deleted it. Often the file wouldn't delete because some other process had an open handle on it so we had to defer the deletion. My solution was to write a class CDeferredFileDelete that tried to delete the file. If it succeeded well and good. If not, it passed the filename to a service and forgot about it. The service was then responsible for deleting the file at some future time. Hmmm maybe I have an idea for another article Smile | :)

In the situation I'm talking about it was relatively simple - the file was marked for deletion and it didn't much matter when the delete occurred just as long as it did occur. Your situation is somewhat different and I don't really know how (short of a seperate thread) to determine that a new file has appeared and is safe to open.

I think I'd approach it by using the notification to add a file object of some sort to a queue controlled by another thread, and have that thread try to open the file in exclusive mode. If success, close the file and add it to a work queue. If fail, try again in the next pass through the loop. Which is not much different from what I've already suggested Smile | :)

I can't think of a better approach.


Rob Manderson

Paul Watson wrote:What sense would you most dislike loosing?

Ian Darling replied.

Telepathy

Then I'd no longer be able to find out everyones dirty little secrets The Lounge, December 4 2003

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 
GeneralRe: opening a doc in IE Pin
Abhi Lahare23-Jan-04 0:26
Abhi Lahare23-Jan-04 0:26 
GeneralListbox select Pin
chadell21-Jan-04 21:39
chadell21-Jan-04 21:39 
GeneralRe: Listbox select Pin
Abhi Lahare21-Jan-04 22:16
Abhi Lahare21-Jan-04 22:16 

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.