CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2008

    Lightbulb Parent Application Freezing

    I'm creating a C++ Plugin for FileMaker and I'm using the Chilkat FTP Library.

    I am showing a progress dialog in a new thread and performing the FTP Download asynchronously but the application still freezes and shows as not responding, but with my progress dialog showing the download is actually working.

    I have seen all of the discusions about using while ( PeekMessage ( &msg, NULL, 0, 0, PM_REMOVE ) etc, but that doesn't seem to help.

    If anyone has any suggestions I would be very grateful.

    Here is my code:

    success = ftp.AsyncGetFileStart(sRemote,sLocal2);
    	if (success != true) {
    		return err;
    	if (bProgress)
    		hThread = CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)ThreadFTPProgress,NULL,0,(LPDWORD)&iID);
    	while (ftp.get_AsyncFinished() != true) 
    		if (bProgress)
    			int iPercent = int( 100.0 * ftp.get_AsyncBytesReceived() / fileSize);
    			if ((iPercent > 0) && (iPercent < 101))
    				SendMessage(pgHWNDFTP, (UINT)PBM_SETPOS, (WPARAM)iPercent,0);
    	if (bProgress)
    	if (ftp.get_AsyncSuccess() == true) {
    		//Download Successful
    long WINAPI ThreadFTPProgress(long lparam)
    	return 0;

  2. #2
    Join Date
    Apr 2009

    Lightbulb Re: Parent Application Freezing

    Did you tried to debug the application with a breakpoint?

    if no, then first debug your program by putting a breakpoint in the suspected area, and step through the code line by line.

    If yes, then what you've got result? In which line/part of the code does it get crashing... what are the values of different variables at that time? did you tried by adding watch to those variables and notice the values of variables at different times?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.