Messages being lost

I have a CWinThread (MFC) derived thread which has a message queue. Whenever the thread uses the ftp library, messages posted to that thread during that time are lost and do not get handled by the thread.

Could it be that the ftp library is handling the messages and maybe we use message id's in the same range?

Any ideas?

Thanks,
Graham

Please be more specific on how your application is designed.

You may want to try to set the UseMessageLoop property of the FTPConnectionMTA class to VARIANT_TRUE (default for FTPConnectionMTA is VARIANT_FALSE). But we recommend to use a separate thread for FTP operations.

The basic scheme would look like this:

CMainThread : public CWinThread
- Creates CFTPThread on Init
- Sends a thread message to the CFTPThread whenever a FTP function should be performed

CFTPThread : public CWinThread
- Calls FTP function e.g. FTPConnectionMTA->Connect().
During this operation the thread messages sent to CFTPThread are queued and executed after the execution of the previous thread message has been completed.
- To abort a FTP operation, call the FTPConnectionMTA->Abort() function directly from the CMainThread.

Remark: In this case the UseMessageLoop property doesn't need to be set to VARIANT_TRUE.

I hope this gives you an idea how to implement it. If not I will try to find some time to extract the relevant code from the SmartFTP Client.

Regards,
-Mat

I have a small test application written in VC++ 2003 which I can send you, that exhibits this condition.

Graham