|
Hi Garth, Just after I had made this posting, I realised that I'd hit this problem once before and hadn't found a solution then either, so your reply wasn't unexpected ! Yes, I think that I'll have to resort to some solution along your lines ! Thanks, and a very happy Christmas to you !
Doug
|
|
|
|
|
I thought of 2 possibilities 'a bit better' than comparing ftp listings
Both really depend on how many files/events you are looking for - one might work for instance with creation of a particular file or a 'low volume' change system than the other - what about :-
1) use FindFirstChangeNotification on the machine you are watching, but add the [possibly filtered] events to a log file ... everytime you ftp from the 'monitoring machine', you grab the log file and erase it
2) use a tcp pub/sub system, the monitored machine publishes [again, possibly filtered] events from FindFirstChangeNotification to subscriber(s) - the monitor machine(s) 'subscribe' to particular events composing of {source machine name, add/change/delete, file(s)} for example - a lot more work, but extensible and applicable to multiple machines you might want to monitor from
not much I know
'g'
|
|
|
|
|
|
Garth, Unfortunately, being a novice, I'm not "in to" Net Framework !! Thanks for your research, nevertheless
Doug
|
|
|
|
|
|
Hi Garth, I think that the real problem is that the folder that I want to watch is on a NAS disk and so the "This code will only work on Windows NT, Windows 2000, or Windows XP, and the directory you wish to watch must also reside on a WindowsNT, Windows 2000, or Windows XP computer" is going to make it a non-starter. I've now implemented a polling _findfirst/_findnext strategy which, although a bit basic, works fine !! (Just hope that the NAS disk can stand the traffic !!) Many thanks for your determination to find me a solution !!! Cheers !
Doug
|
|
|
|
|
Hi,
I have a graphic application (2D editor) compiled on US Windows Vista (using Borland compiler). If I use default mapping mode (MM_TEXT) it works OK in all versions of Windows. However, if I use other mapping modes (MM_HIMETRIC - which changes y axis orientation and my code reflects this) the graphics are not visible in European version of Windows (German, Czech). I have read somewhere that European version of Windows have opposite axis orientation in other than default mapping mode.
If you know how to deal with this problem I would appreciate your time and help.
Thanks,
Denny101
|
|
|
|
|
I didn't know about that, I thought it should be "standard", but... one possibility could be to get the version of windows and adapting your coordinates to the differences.
I use German Windows, by printing or previewing I use:
pDC->SetMapMode (MM_LOMETRIC);
pDC->TextOut (pInfo->m_rectDraw.left, 50 - pInfo->m_rectDraw.bottom, pDoc->GetPathName());
With this I print the path of the file at the bottom of the page.
You say the Y orientation changes between countries, then my
50 - pInfo->m_rectDraw.bottom should change and be pInfo->m_rectDraw.bottom - 50 for US, shouldn't it?
the result is just the change of the sign, at german version will be -X and at US will be X
A way to do it could be getting the version of windows and adapting the +/- to it. So you can get the version of windows (sorry but I don't know how to for sure) at the initialization of the program in BOOL CMyApp::InitInstance() and say:
if ((windows == US) || )
iFactor = 1;
else
iFactor = -1;
and afterwards
pDC->SetMapMode (MM_LOMETRIC);
pDC->TextOut (pInfo->m_rectDraw.left, iFactor(pInfo->m_rectDraw.bottom - 50), pDoc->GetPathName());
Using as coordinates with Y positive to go down, and that would adapt the sign, according to the windows version.
I guess there is a better approach, but this is an idea.
Regards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Thanks Nelek for your help. After some more testing I think the problem is not in the axis orientation but in the screen refreshing. I used a different component for drawing than in my previous programs and it needs a different method of refreshing. I will post the result when I know where the issue was.
All the best,
Denny101
|
|
|
|
|
You are welcome
[quote]
I will post the result when I know where the issue was.
[/quote]
Please do it. I am curious about.
Regards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Hi,
I found the problem with my program running on European Windows - it is in the decimal separator! European use comma, while the US (and all English countries) use dot. My program reads a file with coordinates in a string format. I use Borland Builder C++ and I trusted it that its method AnsiString::ToDouble() makes the conversion according to the OS used - but it does not. After I changed the conversion method to STL C++ strtod() it works fine on all systems.
Regards,
Denny
|
|
|
|
|
Glad you found the solution.
Regards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Upon a cold start, I create an fstream replay file that's opened for output ios::out. If my program stops and does a warm restart, I open the file for ios::in and process the file. Then I close it and reopen it as ios::out | ios::app. This second open succeeds if did not read (getline) any data when opened for ios::in; but fails if I did read data. I thought that flushing the file before closing might have helped, but it didn't. This is not the kind of behavior I, for one would've expected. Any ideas or suggestions?
Thanks
|
|
|
|
|
You can check the stream state for all operations open/create/write you are doing. May be the file is empty while you are opening it?
Checking documentation for fstream may help you..
--
"Programming is an art that fights back!"
|
|
|
|
|
When selecting a different item in my combobox control, I need to save some dialog information for the previously selected item. Which combobox notification should I use for this purpose and how?
Thanks
--
"Programming is an art that fights back!"
|
|
|
|
|
From MSDN:
ON_CBN_SELCHANGE The selection in the list box of a combo box is about to be changed as a result of the user either clicking in the list box or changing the selection by using the arrow keys. When processing this message, the text in the edit control of the combo box can only be retrieved via GetLBText or another similar function. GetWindowText cannot be used.
|
|
|
|
|
Hello, folks,
I set a file association programmically. point the DefaultIcon key value to a .ico file. but after my setting operation. the icon is not be shown with the associated file. but, i noticed that the msi installer can refresh the explore and enable the associated icon with files after installing?
How to enable the setting immediately? what API should i call?
Thanks,
hawk
|
|
|
|
|
UpdateWindow(handle_to_desktop_window)
|
|
|
|
|
I got the answer, refresh explorer by using SHChangeNotify() .
|
|
|
|
|
Hi
I have written a Dialog based Application in VC++ 2008 and also I made some Modeless Dialogs which are created in response of Button Click.
I want my parent Dialog (main Dialog) to be notified of Child Dialog's destroy so I use the below code But It doesn't do any thing while child dialog is closed or destroyed.
void CMyAppDlg::OnParentNotify(UINT message, LPARAM lParam)
{
CDialog::OnParentNotify(message, lParam);
if ((LOWORD(message) == WM_DESTROY))
{
if((HWND)lParam == _mChildDlg->m_hWnd){
::AfxMessageBox(_T("My Code here"));
}
}
}
|
|
|
|
|
How does the child dialog tell the parent it is closing? It won't happen automatically.
Judy
Be wary of strong drink. It can make you shoot at tax collectors - and miss.
Lazarus Long, "Time Enough For Love" by Robert A. Heinlein
|
|
|
|
|
According to the MSDN CWnd::OnParentNotify
A parent's OnParentNotify member function is called by the framework when its child window is created or destroyed, or when the user clicks a mouse button while the cursor is over the child window.
So I think It should work. if not so what should I do?
|
|
|
|
|
From the same link you have given...
[quote]
All child windows except those that have the WS_EX_NOPARENTNOTIFY style send this message to their parent windows. By default, child windows in a dialog box have the WS_EX_NOPARENTNOTIFY style unless the child window was created without this style by calling the CreateEx member function.
[/quote]
How do you create your child dialog?
Regards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Thanks I think that should works
|
|
|
|
|
You are welcome
Regards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|