|
I have an App. A which is accessing a text file. I have created App. B to update automatically the contents of the text file. But I do not want to exit App. A just to recognize my changes. What should I do to make this possible. The only changes I can do is on App. B, since I have just created that application.
|
|
|
|
|
hi
u better continuously query for the file size and keep track of the previuos size. if there is mismatch between previous and current file size, it means App A updated the file, then read that file
naren
|
|
|
|
|
It sounds like you want FindNextChangeNotification() or ReadDirectoryChangesW() . Yes?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Sorry but that is not how it should work since APP A might be using the file but at the same time APP B will be updating the same text file. I would start APP B anytime to make the necessary changes of the text file.
|
|
|
|
|
Either of the two functions that I mentioned can be used by app B to be notified after app A has made changes to some file. Once app B has received notification, it can update the file accordingly. If there is a chance that app A will update the file before app B has finished, I do not know of a solution since you cannot change app A.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I have the following code in CYourView where CYourViewis derived from CRichEditView:
OnTimer(..)
{
if (IsClipboardFormatAvailable(CF_TEXT)
{
if ( pYourView->GetDocument()->seqNumber!=GetClipbardSequenceNumber()
pYourView->OnEditPaste();
}
if (IsClipboardFormatAvailable(CF_METAFILEPICT)
{
if ( pYourView->GetDocument()->seqNumber!=GetClipbardSequenceNumber()
{
CRichEditCtrl& rCtrl = GetRichEditCtrl();
rCtrl.PasteSpecial(CF_METAFILEPICT);
}
}
if (IsClipboardFormatAvailable(CF_DIB)
{
if ( pYourView->GetDocument()->seqNumber!=GetClipbardSequenceNumber()
{
CRichEditCtrl& rCtrl = GetRichEditCtrl();
rCtrl.PasteSpecial(CF_DIB);
}
}
}
Sometimes it pastes and sometimes it doesn't.I cannot understand why.
|
|
|
|
|
On the uninstall section of an application I wrote I have added a shellexecute command which opens the application.
When I run the uninstall from the add\remove programs on win 2000/XP the add\remove programs window , the add\remove program window remaines locked even though the uninstall process has terminated - it seems that running the shellexecute command from the uninstall process is causing this problem.
Can you offer an advise how to overcome this problem?
|
|
|
|
|
Hi,
My name is Michael. I am trying to find a way I can print out an opened browser's x,y,width and length coordinates (like I can with a regular mainframe using the CWnd::GetWindowRect function call). I also want to do other things like count how many images are currently in the browser and get each x,y,width and length from all the images.
What I tried doing was use a loop with a CWnd pointer called wnd that was initialized to point at 'this' (the program's dialog box) before the loop started. Then, I used..
wnd = wnd->GetNextWindow(GW_HWNDPREV);
to point at previous windows in the memory bank, stored the name of each window on a string and kept getting previous windows until ::IsWindow(wnd) was false or until the string "- Netscape" was found within the string. Then I used another loop with...
wnd = wnd->GetNextWindow(GW_HWNDNEXT);
in it instead (to get next windows). Then, when the computer finally found the pointer to any Netscape Browser that was opened, the loop would then terminate. I then used
wnd->GetWindowText(str);
AfxMessageBox(str);
to test it out and it worked! but when I used
wnd->GetWindowRect(size);
I would get some strange numbers until I either minimized or maxamized the browser. Then I would get 0, 0, 600, 800 when the browser was minimized and a constant values between 0 and 600 (for x), 0 and 800 (for y), 0 and 600 (for width), 0 and 800 (for height) and no matter if I resize the browser window, I would get the same numbers. Also, SetWindowText wouldn't work. I found out I need to use something like...
CComPtr<iwebbrowser2> browser;
CComPtr<iserviceprovider> isp;
but I don't know how to use these.
Thank you for any help,
Michael S. Lowe
Michael S. Lowe
|
|
|
|
|
hi all,
I am doing MFC Dialog base Project.Now I want to change the Color of the Menu Bars..
how do I do that?
if any one know it ,please send me a reply..
Thanks in advance..
|
|
|
|
|
How do we detect tone/pulse coming into a modem from a standard telephone? I am using CreateFile to connect to the modem and ReadFile/WriteFile for I/O.
|
|
|
|
|
Typically you need to program the modem to go into voice mode and then it will send you escaped character sequenes to indicate which tones have been detected.
|
|
|
|
|
How can we make the modem go into voice mode?
|
|
|
|
|
I am looking for a sample of how to read a bitmap that has been stored in a OLE Object field in a ms access database and show it on the screen.
|
|
|
|
|
Under IOCTL_DISK_UPDATE_PROPERTIES, how can I find the library or header files?
On Visual C++ 6.0, how to I identify a user who is having what kind of privileges? (i.e admin privilege, etc)
|
|
|
|
|
max_gundam15 wrote:
Under IOCTL_DISK_UPDATE_PROPERTIES, how can I find the library or header files?
This is found in winioctl.h .
max_gundam15 wrote:
On Visual C++ 6.0, how to I identify a user who is having what kind of privileges? (i.e admin privilege, etc)
This question is a bit vague, but does NetUserGetInfo() do what you require?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hello all,
I am stuck at a problem where I am supposed to communicate with a telephone using a modem. I am using the API functions of CreateFile, ReadFile, and WriteFile for this purpose. I need to send phone pulses to the other end and receive pulses from the other end. I have managed to establish connection and send pulses to the remote telephone but I cannot receive the pulses the remote telephone is sending me. Is there a special modem command for this? Do I need a special setting? Help, I am stuck!
|
|
|
|
|
You should use TAPI (Telephony API) instead of Win32 CreateFile . See Visual Studio docs or MSDN for a reference and examples. TAPI is installed with Platform SDK, so it comes bundled with most Visual Studio distributions, and/or you can download it from the Internet as well.
TAPI has a function pair called lineGenerateDigits and lineGatherDigits that generate and gather pulse sequences that represent numbers. You can also send and monitor individual pulses with lineGenerateTone and lineMonitorTone .
These functions only exists in TAPI version 2.x. In version 3.x, the COM model is introduced, and everything running on the phone line is considered a stream, with terminal objects acting as sinks. For your case, I suggest TAPI 2.x, if possible. The COM model is too complex for the functionality you require.
-Antti Keskinen
----------------------------------------------
"If we wrote a report stating we saw a jet fighter with a howitzer, who's going to believe us ?"
-- R.A.F. pilot quote on seeing a Me 262 armed with a 50mm Mauser cannon.
|
|
|
|
|
thanks
|
|
|
|
|
31, 28 (29), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
modified 12-Sep-18 21:01pm.
|
|
|
|
|
How can I implement timer in in Windows (2000/XP )with resolution of 1 milisecond
or better. Multimedia timer seems to be not accurate enough, but may be I am not using it right?
Thanks
DavidR
|
|
|
|
|
|
Bear in mind that although you can use QueryPerformanceCounter() to get an accurate elapsed time, you *cannot* get things to happen regularly at for example 1ms intervals.
Windows has an internal "clock" of (from memory) 12.5ms, and doing anything more often than that (reliably) just doesn't work.
using System.Beer;
|
|
|
|
|
Jon Hulatt wrote:
Windows has an internal "clock" of (from memory) 12.5ms...
Close. For Windows 9x/Me, the system clock ticks at 55 ms. For Windows NT, it ticks at 10 ms. This is the best that can be obtained with a non-RTOS system.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I am trying to read from a CFile object using CArchive and an overridden Serialize Function for a CObject derived object.
My problem is that how do i traverse through all the objects in the file with the Serialize function, and come to know that the end of file has been reached.
|
|
|
|
|
Can any one tell me how to add 'OK' AND 'CANCEL' button to modeless propertysheet just like the model one?
Lisoft
|
|
|
|