|
I'd always go for simplest You can't rely on when the file notification will occur (I think it happens shortly after the file is created for the simple reason that the filesystem has no knowledge about how long the file will be or how long it will be open). Since you can't rely on the file being exclusively available when you get the notification it seems simplest to throw the notification to a monitor thread that will tell your main app when the file really is exclusively available.
Hmmm, after a moments reflection, it seems to me that the only way to be absolutely sure is to have the monitor thread open the file exclusively and throw the HANDLE to the main app thread.
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
|
|
|
|
|
Wouldn't it just be simpler to create an IOCompletionPort and have thread B wait with a
while (GetQueuedCompletionStatus(pLightningServer->m_hIOCompletionPort,(ULONG *)&pECB,&pUnused,&pOverlapped,INFINITE))<br />
{<br />
if (pOverlapped == (OVERLAPPED *)0xFFFFFFFF)<br />
break;
<br />
}
and then thread A would simply post the file name to the IOCompletionPort when the copy is complete.
Simple, clean, and resource friendly...
onwards and upwards...
|
|
|
|
|
Hmmm you may be right I really have to study up on IO Completion Ports
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
|
|
|
|
|
They are really pretty straightforward and provide a nice queueing mechanism. The problem is that most people don't think of them unless they are doing actual I/O or thread pooling.
onwards and upwards...
|
|
|
|
|
Hi,
I've met the same issue. My work-around was to Sleep for a small amount of time (say, 100 ms) and retry the file opening only once. Not the nicest way but it seems to work for a long time.
|
|
|
|
|
Hello,
Is it possible to have toolbar on CDialogBar, while my CDialogBar in on CRebar..
the code is as follows
private :
CStatusBar m_wndStatusBar;
CToolBar m_wndToolBar;
CMyDialogBar m_wndDialogBar;
CReBar r1 ;
CBitmap bitmap;
.
.
.
r1.Create(this);
!m_wndDialogBar.Create(IDD_DIALOGBARX,this)
m_wndToolBar.CreateEx(this, WS_CHILD|TBSTYLE_FLAT | TBSTYLE_TRANSPARENT ));
m_wndToolBar.LoadToolBar(IDR_MAINFRAME);
.
.
r1.AddBar(&m_wndDialogBar, "Second Rebar" ,0,RBBS_GRIPPERALWAYS | RBBS_CHILDEDGE ) ;
r1.AddBar ( &m_wndToolBar, "First Rebar" ,0,RBBS_GRIPPERALWAYS | RBBS_CHILDEDGE ) ;
Now what I want is toolbar on Dialog Bar..while my dialog bar in on Rebar..is it possible, if so How???
regards
Balkrishna Talele
|
|
|
|
|
Dear All,
Pls help me as am a novice to programming especially in VC and don’t know how to mask a voice using FFT. Is there any other way throurh which I can change or mask the voice. Or anyother code through which i be able to mask or change the voice. (.wav file) Or any function which can change the pitch of the wav file.
Pls I need ur help badlly as am running out of time for my final project.
Kind regards
Jenny
|
|
|
|
|
Hello!
Take a look maybe at DirectX API, but probably You will not find interesting functions there. Look at http://sourceforge.net , make some searches over net.
Probably not very helpful, but anyway :P
|
|
|
|
|
Hi ALL.
How i can open doc file in IE Broswer? I don't want to use any scripting language. can any point me in right direction?
Thanks in adavnce
|
|
|
|
|
Maybe you could open a instance of IE programatically along with the URL to the doc file?
The word of the day is legs, let's go back to my house and spread the word
|
|
|
|
|
<br />
ShellExecute(NULL,<br />
"open",<br />
"c:\\program files\\Internet Explorer\\IEXPLORE.EXE",<br />
"c:\\test.doc",<br />
NULL, <br />
SW_SHOWNORMAL); <br />
greatest thing is to do wot others think you cant suhredayan@omniquad.com
|
|
|
|
|
Hi Suhredayan,
When I try to use the ShellExecute() function, Its open a new instance of word and open c:\\test.doc and not in IE Window.
I am using IE6 Browser and having word2000. Does it depends upon version of either IE or Word ??
Again thanks in advanace
AL
|
|
|
|
|
Are you sure you specified 3rd parameter as "IEXPLORER.EXE"
greatest thing is to do wot others think you cant suhredayan@omniquad.com
|
|
|
|
|
Yes,
Here this is what i am doing
ShellExecute(NULL,"open","c:\\program files\\Internet Explorer\\IEXPLORE.EXE",
"c:\\test.doc", NULL, SW_SHOWNORMAL);
Its strange thing that if test.doc is not on the disk, Its gives error Dialog Box cannot find file:///c:/test.doc, MaKe sure that path is correct or Internet address is correct.
Also there is no iexplore.exe process(which is swapn by ShellExecute function) running in task manager.
Thanks once again
AL
|
|
|
|
|
I have a dialog with a listbox control and a edit box, so when the user selects a listbox string the edit box has to be update. my question is, how can I know (which message) that the user has selected a string?
I'm using visual c++ 6.0 without MFC, only winapi32.
thanks
Christian
|
|
|
|
|
|
the link should be
http://msdn.microsoft.com/library/en-us/shellcc/platform/commctls/listboxes/usinglistboxes.asp
Sorry About that.
|
|
|
|
|
How to add and delete items in combo with out MFC...
ASHU
|
|
|
|
|
Look into CB_ADDSTRING and SendDlgItemMessage()
The word of the day is legs, let's go back to my house and spread the word
|
|
|
|
|
Is there any hook handler sort of thing for Registry ?
How can i kow if some application is trying to access windows Registry ?
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
|
Hello,
Use Norton Utilities ( Registry tracker) or There is free code on CP for registry tracking!!!
regards
Balkrishna Talele
|
|
|
|
|
Dear Friends,
In case of rich edit control, the line break is done by the control itself i.e when the maximum limit of horizontal characters is reached, the control automatically transfer the caret to next line and do vertical scrolling.
I like to "reverse" the default behaviour according to which the control does line break . The control does line break from the right side no matter what allignment we are using. I like the control to make line break on the left side. How can i do so ??
|
|
|
|
|
i wish to show user-name and product code in the about dialog box. the function used for this task is msigetproductcode() and msigetproductinfo(), could you please tell me, exactly what parameters should i pass into the function.
the prototype is
UINT MsiGetProductCode(
LPCTSTR szComponent,
LPTSTR lpProductBuf
);
what does this szComponent refer to and what value should i pass.
never say die
|
|
|
|
|
Hello Friends ,
i am doing Network Monitoring project on VC++ projetc ..from that program i am able to capture all the packets passing through the system , the problem i am having is i don't know how to store the captured packet .
Since large amount of packets are coming i don't know how to store the captured packets .. if any body knows how to solve the problem pls reply regarding it..
|
|
|
|