|
Julberto Danray wrote: PreSubclassWindow
That's cool if it works, but how does the the CWnd object get associated with the control before it is created?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I'm assuming the the control is being subclassed via SubclassDlgItem() or DDX_Control(). In either case PreSubClassWindow() will be called.
This is a very convenient way to initialize your subclassed controls because it does not require any special treatment from the dialog that contains the control.
Julberto
|
|
|
|
|
Right, but the OP is trying to catch WM_CREATE, which has occurred long before the first
DDX_Control() call.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Dear Sir:
I want to monitor a remote directory hosted on an FTP server to check up whether there are some newer files (compared with my local downloads) or not. If any, new files will be downloaded automatically.
I understand in the rough how to do that. Firstly, start a timer and periodically examine certain FTP remote folder through the use of CFtpFileFind member functions to check up whether there are some newer files (compared with my local downloads, but keeping a download timestamp may be a good idea) or not. But in case that the file is not completly written to the remote FTP folder, and at the same time my FTP monitor thread is going to be activated to do its checking job. How can I cope with this kind of "race condition" as ideal as possible?
BTW, any recommendations to the source codes concerned either free or commercially available are highly appreciated. Any suggestions are heartily welcome!
Thank you!
|
|
|
|
|
Firstly if there's another way other than polling the server I suggest you take it, kinder to the server.
With regards to your problem, why don't you check back (the next day or something) once a new file has been "discovered" and compare sizes, if the two are the same then you can download the file, if not wait another day and compare again to see if it's not growing anymore.
|
|
|
|
|
Dear Poore:
Thank you for your kind advice. I know polling the FTP server is not a good idea. My system must frequently check up the FTP server because some new data files will be put on the FTP server every 15 or 30 minutes. User can't wait any longer (not say wait until next day) because the successive production task will be carried out as earlier as possible. Our system is a time critical system.
Any suggestions? Could you kindly recommend any commercial or open source codes for me? Thank you again!
|
|
|
|
|
Golden Lee wrote: User can't wait any longer (not say wait until next day)
I just used the example of a day to keep from polling the servers too frequently. You could check the next time you poll, i.e. 15 minutes later. That way at worst it'll start 14 minutes late. Or you could set up something so that if and only if there's a new file detected then check only that file in a minutes time (depending on how fast you think files will be uploaded).
Golden Lee wrote: Could you kindly recommend any commercial or open source codes for me?
Sorry I don't know of anything
|
|
|
|
|
Golden Lee wrote: I want to monitor a remote directory hosted on an FTP server to check up whether there are some newer files (compared with my local downloads) or not.
Have you considered ReadDirectoryChangesW() or FindFirstChangeNotification() ?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Thank you for your suggestion. ReadDirectoryChangesW() or FindFirstChangeNotification function is usually used for watching local or UNC folder (\\computername\driveletter:\folder), not suitable for monitoring the remote folder on an FTP host running under Windows, Linux, Unix or other operating systems.
Thank you anyway!
|
|
|
|
|
Golden Lee wrote: ...Linux, Unix or other operating systems.
I did not see this constraint in your initial post or I would have not suggested what I did. Periodic polling is your only recourse.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi,
I want to call a function on each line of code of my program. To achieve this, one way to is that I should call that function on each end of statement, but does there any event exist to do that, so that my function should be called automatically after end of each statement.
Best Regards,
Mushq
Mushtaque Ahmed Nizamani
Software Engineer
Ultimus Pakistan
|
|
|
|
|
No, absolutely not.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I have an application with MFC Client and COM Server. I want to show an ICON in my system satus bar which has to show my server is running or not.
Please give me guidence to Read the server status.
Bye,
Royal.
|
|
|
|
|
The Shell_NotifyIcon() Function[^] can be used to add/remove/update icons in the taskbar status area.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
The GDIPlus function "GetPixel" can't deal with this kind image well, the value which get from "GetPixel" is from 0 to 255, it losts accuracy. How can I get its original value?
Any help appreciate.
|
|
|
|
|
Windows can't show a 48BPP image anyhow. But, you'll have to get a pointer to the bitmap data and iterate over it yourself, although, to be honest, for Windows to do anything with that image, it needs to modify it, because a windows bitmap simply doesn't have the room for 46 bits per pixel. So, it may not even be that in memory, it sure isn't that on your screen.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Once I used "LockBits" to get its memory pointer, I combine every six bytes as a pixel, but the value was very different from the true value which I get from matlab. It must have realtion with the picture's format. Maybe I have to use matlab engine to get the true value.
Thanks.
|
|
|
|
|
GDI+ 1.0 does not support LockBits() in PixelFormat48bppRGB (or any of the 64bpp formats).
I believe GDI+ 1.1+ supports it, but this is Vista+ only. I haven't tried it.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I am so sorry to hear that, maybe I have to use some open source library.
|
|
|
|
|
Hi:
char szBuffer[10240];
try
{
pFile =(CHttpFile*)session.OpenURL(......);
pFile->Read(szBuffer,10240);
}
I open this url with ie,it's ok!But I can not get all code of the page with OpenURL Why? here,it is the code read form szBuffer!
Thank you!
////////////////////////////////////////////////////////////////////////////
<html>
<head>
<title>Ad Only PTC Site : View Link Ad</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Keywords" content="advertise,earn,money,internet,free,market,hits,links,banners,banner,link,impression,impressions">
<meta name="Description" content="Need Some Extra Cash? Get Paid Up To 1 Cent Per Click! Advertise An Recieve Unique Hits!">
<meta name="Copyright" content="Copyright ?2003 adonlyptc.us. All rights reserved">
<meta name="Distribution" content="Global">
<meta name="Rating" content="General">
<meta name="Robots" content="All">
<meta name="Revisit-After" content="7 Days">
<link rel="StyleSheet" href="templates/default2/layout.css" type="text/css">
<link rel="stylesheet" type="text/css" href="includes/ajax/components.css">
<script language="javascript" src="functions.js"></script>
<!-- Load Ajax -->
</link></link></meta></meta></meta></meta></meta></meta></meta></meta></head>
<body>
<div align="center">
<table widt<br="" mode="hold" />
/////////////////////////////////////////////////////////////////////////// </div></body></html>
modified on Sunday, February 24, 2008 5:32 AM
|
|
|
|
|
can u please format your message by selecting "Ignore HTML tags in this message" check box, because of it no other messages can be viewed in the page
|
|
|
|
|
I'm trying to obtain the filelist for a directory tree.
A way is to redirect a dir command to a file and to read that file.
How can this be done in VC++ 6?
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
Instead of redirecting the output of a dir command, you can do the same thing directly in your program using FindFirstFile() [^] and FindNextFile() [^]. These are Windows API functions that you can use from VC6.
|
|
|
|
|
Actually, is not what I'm looking for. I need a function that is listing ALL the structure, including what the subfolders amd sub-subfolders, ..., and so on ... do contain. To avoid recursively use of findfirst , findfnext pair and to obtain all the list into a single step.
Is there anything like this in VC++6 ?
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
RomTibi wrote: Actually, is not what I'm looking for.
Yes, it is. Gary's suggestion still applies whether you want one level or multiple levels.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|