Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2004
    Posts
    7

    Grin Problem with luaCOM.Connect

    I have a project which uses the luaCOM plugin to call a DLL (written in VB6) which updates a database by running a series of scripts. The DLL raises events whenever a script starts or stops. The following snippet shows what I'm doing:

    DatabaseManager_events = {}
    function DatabaseManager_events:OnScriptStart(Name)
    SetupData.WriteToLogFile("Notice\tScript started: "..Name.."\r\n");
    end
    function DatabaseManager_events:OnScriptStop(Abort)
    SetupData.WriteToLogFile("Notice\tScript stopped\r\n");
    end
    function UpdateDatabase(Action)
    DatabaseManager = luacom.CreateObject("DBUpdate.DatabaseManager");
    assert(DatabaseManager);
    res, cookie = luacom.Connect(DatabaseManager, DatabaseManager_events);
    DatabaseManager:UpdateDatabase();
    DatabaseManager = nil;
    collectgarbage();
    end

    The code executes fine, and the log has my lines showing the names of each script. The problem is that after the setup runs, I get a Windows popup saying "Setup Application has encountered an error and needs to close". If I comment out the luacom.Connect line, it works fine (but doesn't log the scripts, of course).

    Anyone know what I'm doing wrong?

  2. #2
    Join Date
    Nov 2004
    Posts
    7
    No one has an idea?

  3. #3
    Join Date
    Jun 2005
    Posts
    470
    The problem may be in the dll, not in the SF generated setup
    To check try with a dummy dll that makes nothing

  4. #4
    Join Date
    Nov 2004
    Posts
    7
    Thanks for the suggestion. If I comment out the line that calls the DLL, so that the code looks like this:

    DatabaseManager_events = {}
    function DatabaseManager_events:OnScriptStart(Name)
    SetupData.WriteToLogFile("Notice\tScript started: "..Name.."\r\n");
    end
    function DatabaseManager_events:OnScriptStop(Abort)
    SetupData.WriteToLogFile("Notice\tScript stopped\r\n");
    end
    function UpdateDatabase(Action)
    DatabaseManager = luacom.CreateObject("DBUpdate.DatabaseManager");
    assert(DatabaseManager);
    res, cookie = luacom.Connect(DatabaseManager, DatabaseManager_events);
    --DatabaseManager:UpdateDatabase();
    DatabaseManager = nil;
    collectgarbage();
    end

    The same thing happens - I get the Windows application error.

  5. #5
    Join Date
    Jun 2005
    Posts
    470
    I would put a message box after each operation to see where is the problem.

    Other things that come to mind
    - load & use the .dll from a vb6 exe to see if it will cause a crash when performing the same operations - this way debugging will be a lot easier, in case the problem is in the dll

    - as I understand , you use this dll to write data to a DB. If this is a one-way process (setup only writes to but does not need to read from DB), try to simplify things and remove the dll at all. Make it exe which writes to DB parameters passed via command line. Or write events to a text file during setup and at the end call an exe that puts all of them together in the DB.

  6. #6
    Join Date
    Nov 2004
    Posts
    7
    Thanks for the reply, pww. I have already put in debugging after every line, and have even commented out almost every line. For example, the following still gets the Windows system error:

    DatabaseManager_events = {}
    function DatabaseManager_events:OnScriptStart(Name)
    --SetupData.WriteToLogFile("Notice\tScript started: "..Name.."\r\n");
    end
    --function DatabaseManager_events:OnScriptStop(Abort)
    --SetupData.WriteToLogFile("Notice\tScript stopped\r\n");
    --end
    function UpdateDatabase(Action)
    DatabaseManager = luacom.CreateObject("DBUpdate.DatabaseManager");
    --assert(DatabaseManager);
    res, cookie = luacom.Connect(DatabaseManager, DatabaseManager_events);
    --DatabaseManager:UpdateDatabase();
    --DatabaseManager = nil;
    --collectgarbage();
    end

    I suspect there is a bug in the luaCOM plugin in the implementation of the event sink. I am investigating replacing the DLL COM call with an executable (as you suggest) to avoid the issue. I've reported the same problem on the Icy North forum, but no luck yet there either.

Similar Threads

  1. Problem installing fonts
    By ByronFS in forum Setup Factory 7.0
    Replies: 5
    Last Post: 05-08-2006, 12:23 PM
  2. Video Problem
    By ScottDuncan in forum AutoPlay Media Studio 5.0
    Replies: 0
    Last Post: 07-10-2004, 01:38 PM
  3. PROBLEM: Setup Starts and then Crashes
    By Support in forum Setup Factory 5.0
    Replies: 0
    Last Post: 10-15-2002, 03:02 PM
  4. PROBLEM: Setup Requests Disk 2 in a Single File Setup
    By Support in forum Setup Factory 6.0 Knowledge Base
    Replies: 0
    Last Post: 10-09-2002, 02:04 PM
  5. INFO: Tips for Debugging Action Lists in AutoPlay Media Studio 4.0
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-03-2002, 08:38 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