User Tag List

Results 1 to 4 of 4

Thread: [Help] Program hangs during a process in extension

  1. #1
    No Products Registered

    Join Date
    Nov 2006
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Help] Program hangs during a process in extension

    I have written an mfx extension for my program which has an action LoadCurrentSession. LoadCurrentSession calls a function called ExtractFiles() that basically extracts files onto system, which takes about 40 to 60 seconds.

    The problem is that as soon as I call the action LoadCurrentSession, my application hangs for about 40 to 60 seconds until the operations by LoadSession() are done.
    Is there any way I could prevent the application from getting hanged? I instead want some kind of visual communication like a progress bar to be used, but since the application gets hanged, the user will be unable to see the progress bar.

    Here's what LoadCurrentSession does:

    short WINAPI DLLExport Act_LoadCurrentSession(LPRData rdPtr,long Param1,long Param2)
    {
    ExtractFiles();
    return 0;
    }


    Thanks in advance.

  2. #2
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jun 2006
    Location
    Darlington, UK
    Posts
    3,298
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: [Help] Program hangs during a process in exten

    You need to learn how to use threads. You can use a thread to run the "extract files" function and at the same time have your Act_LoadCurrentSession() function continue running (and return, and have mmf continue running).

    Reporting back a progress is a bit more difficult, and involves thread synchronisation.

    Google for more.

  3. #3
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

    Join Date
    Jun 2006
    Posts
    6,773
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: [Help] Program hangs during a process in exten

    short WINAPI DLLExport Act_LoadCurrentSession(LPRData rdPtr,long Param1,long Param2)
    {
    CreateThread(NULL,NULL,(LPTHREAD_START_ROUTINE)Ext ractFiles,NULL,NULL,NULL);
    return 0;
    }

  4. #4
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

    Join Date
    Jun 2006
    Posts
    6,773
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: [Help] Program hangs during a process in exten

    Too late to edit, but I didn't read your post properly- if you want to communicate with your thread, the easiest way is to give it access to rdPtr-

    short WINAPI DLLExport Act_LoadCurrentSession(LPRData rdPtr,long Param1,long Param2)
    {
    CreateThread(NULL,NULL,(LPTHREAD_START_ROUTINE)Ext ractFiles,(LPVOID)rdPtr,NULL,NULL);
    return 0;
    }

    and then ExtractFiles should be

    void ExtractFiles(LPRDATA rdPtr) {
    }

Similar Threads

  1. Build 5 Upgrade - app hangs.
    By phanchingchong in forum iOS Export Module Version 2.0
    Replies: 20
    Last Post: 26th October 2012, 08:07 PM
  2. Bug Report - App Hangs
    By scottige in forum Android Export Module Version 2.0
    Replies: 2
    Last Post: 29th March 2011, 09:59 AM
  3. Program stays on process list after it exits
    By ace in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 25th April 2010, 01:30 PM
  4. FTP object hangs another MMF application?
    By Pablo in forum Multimedia Fusion 2 - Technical Support
    Replies: 8
    Last Post: 23rd October 2006, 02:38 PM
  5. Working draft of a new extension- Process object
    By James in forum Extension Developers Lobby
    Replies: 13
    Last Post: 23rd August 2006, 02:26 AM

Posting Permissions

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